suppressed logging of invalid values in 1wire protocol

This commit is contained in:
Steffen Vogel 2011-08-05 01:27:45 +02:00
parent 91145f4c83
commit 3490213877

View file

@ -57,6 +57,8 @@ reading_t onewire_get(void *handle) {
char buffer[16];
int bytes;
do {
rewind((FILE *) handle);
bytes = fread(buffer, 1, 16, (FILE *) handle);
@ -66,6 +68,7 @@ reading_t onewire_get(void *handle) {
rd.value = strtof(buffer, NULL);
gettimeofday(&rd.tv, NULL);
}
} while (rd.value == 85) { /* skip invalid readings */
return rd;
}