From af7e7aed198ffa290ef093faaf6ff052c7bc44be Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 12 Aug 2016 11:47:41 +0200 Subject: [PATCH] Fix the decoding of the dive time. The dive time is stored in two separate bytes: one for the number of minutes, and another one for the hours. Since we only took into account the first byte containing the minutes, the divetime for dives longer than one hour was always too short. --- src/oceanic_veo250_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oceanic_veo250_parser.c b/src/oceanic_veo250_parser.c index a300af8..7be86c4 100644 --- a/src/oceanic_veo250_parser.c +++ b/src/oceanic_veo250_parser.c @@ -162,7 +162,7 @@ oceanic_veo250_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, un if (value) { switch (type) { case DC_FIELD_DIVETIME: - *((unsigned int *) value) = data[footer + 3] * 60; + *((unsigned int *) value) = data[footer + 3] * 60 + data[footer + 4] * 3600; break; case DC_FIELD_MAXDEPTH: *((double *) value) = parser->maxdepth;