X-Git-Url: https://git.ao2.it/visomat-utils.git/blobdiff_plain/760d9ce1d8a334800fd138c019a4f08e4a56f990..32d3e4d3b1e13fc36501cd90a2ff85644670af3f:/src/visomat-data-downloader.c diff --git a/src/visomat-data-downloader.c b/src/visomat-data-downloader.c index 08a752a..d925388 100644 --- a/src/visomat-data-downloader.c +++ b/src/visomat-data-downloader.c @@ -63,6 +63,7 @@ struct datetime { }; struct pressure { + unsigned int flag; /* XXX Maybe this means arrhythmia? */ unsigned int systolic; unsigned int diastolic; unsigned int pulses; @@ -102,10 +103,16 @@ static void print_record_csv_compat(struct datetime *d, struct pressure *p) pulse_pressure = p->systolic - p->diastolic; printf("%u;", pulse_pressure); + if (p->flag) + printf("x"); + +#if 0 + /* The original software does not seem to be doing that */ if (p->pulses > 100) printf("tachycardia"); else if (p->pulses < 60) printf("bradycardia"); +#endif printf("\n"); } @@ -157,11 +164,12 @@ static int decode_eeprom(unsigned char *buffer, unsigned int len) i += 10; ret = sscanf((char *)(buffer + i), - "%04u%03u%03u", + "%1u%03u%03u%03u", + &p.flag, &p.systolic, &p.diastolic, &p.pulses); - if (ret != 3) + if (ret != 4) return -EINVAL; /* pressure data is 10 bytes */