From 488c396656cfe5d6a91a731a88f1d5c31637d29a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 23 Feb 2015 22:37:24 +0100 Subject: [PATCH 1/2] Fix the hour for the Oceanic Veo 2 and 3. For BCD encoding the hour in a 12 hour clock system, only 5 bits are required. The extra two bits are used for storing the freedive/gauge mode. --- src/oceanic_atom2_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 491e74b..8482f46 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -199,7 +199,7 @@ oceanic_atom2_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetim datetime->year = ((p[3] & 0xE0) >> 1) + (p[4] & 0x0F) + 2000; datetime->month = (p[4] & 0xF0) >> 4; datetime->day = p[3] & 0x1F; - datetime->hour = bcd2dec (p[1] & 0x7F); + datetime->hour = bcd2dec (p[1] & 0x1F); datetime->minute = bcd2dec (p[0]); break; case ZENAIR: From 41834a31c7db703702f9486712a918279d84da6d Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 23 Feb 2015 22:49:09 +0100 Subject: [PATCH 2/2] Fix the freedive mode for the Oceanic Veo 2 and 3. In freedive mode, the Oceanic Veo 2.0 and 3.0 have samples that are only 4 bytes long, instead of the normal 8 bytes. The Oceanic VT3 and Hollis DG03 use the same logbook layout, and although I haven't been able to confirm this with real data, it's very likely they need the same fix. --- src/oceanic_atom2_parser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 8482f46..c7d1b46 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -339,6 +339,9 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns mode = FREEDIVE; } else if (parser->model == T3B) { mode = (data[2] & 0xC0) >> 6; + } else if (parser->model == VEO20 || parser->model == VEO30 || + parser->model == VT3 || parser->model == DG03) { + mode = (data[1] & 0x60) >> 5; } if (!parser->cached) { @@ -500,6 +503,9 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ mode = FREEDIVE; } else if (parser->model == T3B) { mode = (data[2] & 0xC0) >> 6; + } else if (parser->model == VEO20 || parser->model == VEO30 || + parser->model == VT3 || parser->model == DG03) { + mode = (data[1] & 0x60) >> 5; } unsigned int time = 0;