From cb2a4f4a72367f21c7cbc708fd96c96cef62ca2a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sat, 2 Sep 2017 10:31:19 +0200 Subject: [PATCH] Use more descriptive names Those two samples are no longer unknown. The first one contains some freedive related data, and the second one contains some additional data with several sub types. At the moment only the tank and gas mix info is used. --- src/uwatec_smart_parser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index 78f68bd..639d0e4 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -74,8 +74,8 @@ typedef enum { BEARING, ALARMS, TIME, - UNKNOWN1, - UNKNOWN2, + APNEA, + MISC, } uwatec_smart_sample_t; typedef enum { @@ -292,8 +292,8 @@ uwatec_smart_sample_info_t uwatec_smart_galileo_samples[] = { {HEARTRATE, 1, 0, 8, 0, 1}, // 1111 0111 dddddddd {BEARING, 1, 0, 8, 0, 2}, // 1111 1000 dddddddd dddddddd {ALARMS, 1, 2, 8, 0, 1}, // 1111 1001 dddddddd - {UNKNOWN1, 1, 0, 8, 0, 0}, // 1111 1010 (8 bytes) - {UNKNOWN2, 1, 0, 8, 0, 1}, // 1111 1011 dddddddd (n-1 bytes) + {APNEA, 1, 0, 8, 0, 0}, // 1111 1010 (8 bytes) + {MISC, 1, 0, 8, 0, 1}, // 1111 1011 dddddddd (n-1 bytes) }; @@ -1091,14 +1091,14 @@ uwatec_smart_parse (uwatec_smart_parser_t *parser, dc_sample_callback_t callback case TIME: complete = value; break; - case UNKNOWN1: + case APNEA: if (offset + 8 > size) { ERROR (abstract->context, "Incomplete sample data."); return DC_STATUS_DATAFORMAT; } offset += 8; break; - case UNKNOWN2: + case MISC: if (value < 1 || offset + value - 1 > size) { ERROR (abstract->context, "Incomplete sample data."); return DC_STATUS_DATAFORMAT;