From 1d2ebd7af11881cd02fc5a337e8a27f265e5fb09 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 28 Oct 2014 09:00:45 +0100 Subject: [PATCH] Fix the header size for the Oceanic VT4 and VT4.1. This change was already present in the oceanic_atom2_parser_get_field() function, but not in the oceanic_atom2_parser_samples_foreach() function. These two should always be kept in sync. This fixes a bug in the tank pressure detection. --- src/oceanic_atom2_parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index f38afef..3eb9c64 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -456,6 +456,9 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ // Get the offset to the header sample. unsigned int header = headersize - PAGESIZE / 2; + if (parser->model == VT4 || parser->model == VT41) { + header = 3 * PAGESIZE; + } unsigned int time = 0; unsigned int interval = 1;