From 69fec57ed7d361d5312c5b0f40a859e8d8fa3861 Mon Sep 17 00:00:00 2001 From: Janice McLaughlin Date: Tue, 28 Oct 2014 09:14:25 +0100 Subject: [PATCH] Fix the gas mixes for the Aeris A300AI. The Aeris A300AI supports 4 instead of 3 gas mixes. The offset where the gas mixes are stored was wrong too. --- src/oceanic_atom2_parser.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 3eb9c64..1432fa3 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -321,7 +321,8 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns // Get the offset to the header and footer sample. unsigned int header = headersize - PAGESIZE / 2; unsigned int footer = size - footersize; - if (parser->model == VT4 || parser->model == VT41) { + if (parser->model == VT4 || parser->model == VT41 || + parser->model == A300AI) { header = 3 * PAGESIZE; } @@ -361,7 +362,7 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns if (parser->model == DATAMASK || parser->model == COMPUMASK) { *((unsigned int *) value) = 1; } else if (parser->model == VT4 || parser->model == VT41 || - parser->model == OCI) { + parser->model == OCI || parser->model == A300AI) { *((unsigned int *) value) = 4; } else if (parser->model == TX1) { *((unsigned int *) value) = 6; @@ -456,7 +457,8 @@ 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) { + if (parser->model == VT4 || parser->model == VT41 || + parser->model == A300AI) { header = 3 * PAGESIZE; }