From f923ec3889bd4a8766029feafcb5d609c834fddc Mon Sep 17 00:00:00 2001 From: Janice McLaughlin Date: Fri, 14 Mar 2014 08:53:48 +0100 Subject: [PATCH] Fix the gas mixes for the Oceanic OCi. The Oceanic OCi supports 4 gas mixes instead of just 3, and they are stored at a different offset. --- src/oceanic_atom2_parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index a3cd39c..ae93c87 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -324,7 +324,7 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns case DC_FIELD_GASMIX_COUNT: if (parser->model == DATAMASK || parser->model == COMPUMASK) *((unsigned int *) value) = 1; - else if (parser->model == VT4 || parser->model == VT41) + else if (parser->model == VT4 || parser->model == VT41 || parser->model == OCI) *((unsigned int *) value) = 4; else *((unsigned int *) value) = 3; @@ -332,6 +332,8 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns case DC_FIELD_GASMIX: if (parser->model == DATAMASK || parser->model == COMPUMASK) nitrox = data[header + 3]; + else if (parser->model == OCI) + nitrox = data[0x28 + flags]; else nitrox = data[header + 4 + flags]; gasmix->helium = 0.0;