From 95920af7b7eb2963ef0dacf91ed1afaf8c1644d0 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 4 Mar 2021 12:16:57 +0100 Subject: [PATCH] Fix the maximum depth The upper bits appear to contain some other (currently unknown) information. The Oceanic VT Pro specifications list a maximum depth of 399 ft (120 m), which requires only 9 bits. The Oceanic application also ignores the higher bits. --- src/oceanic_vtpro_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oceanic_vtpro_parser.c b/src/oceanic_vtpro_parser.c index d09b2f9..54a52d8 100644 --- a/src/oceanic_vtpro_parser.c +++ b/src/oceanic_vtpro_parser.c @@ -181,7 +181,7 @@ oceanic_vtpro_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns maxdepth = data[footer + 1]; } else { oxygen = data[footer + 3]; - maxdepth = array_uint16_le(data + footer + 0) & 0x0FFF; + maxdepth = array_uint16_le(data + footer + 0) & 0x01FF; } dc_gasmix_t *gasmix = (dc_gasmix_t *) value;