From 4fd825cdac341a2d4a1366c6deb7d4a71bbdf94d Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sat, 7 Mar 2015 23:27:26 +0100 Subject: [PATCH] Uwatec Aladin Tec 2G supports maximum 2 gas mixes. According to the technical specifications, the Uwatec Aladin Tec 2G supports maximum two gas mixes. The data appears to confirm this, because the extra third gas mix always contains unrealistic oxygen percentages. However, I came across some data containing gas switches to the third gas mix. The interesting part is that according to the Uwatec application, this is actually a switch to the second gas mix in the header. One possible explanation is that for models with up to 3 gas mixes, they are labelled respectively "bottom", "travel" and "deco" mix. But the documentation for the Aladin Tec 2G only refers to the bottom and deco mix. So it might be that internally the index of the deco mix is always the 3th mix, regardless of whether a travel mix is supported or not. If the only allowed values for the gas mix index are 0 (for the bottom mix) or 2 (for the deco mix), then manually remapping the deco mix is equivalent with ignoring the lowest bit. This has the advantage that the required bitmasks and shifts are no longer different from those for the other models. --- src/uwatec_smart_parser.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index ef0e682..a4c002f 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -151,7 +151,7 @@ static const uwatec_smart_header_info_t uwatec_smart_aladin_tec2g_header = { 22, 26, - 34, 3, + 34, 2, 30, /* temp_minimum */ 28, /* temp_maximum */ 32, /* temp_surface */ @@ -713,11 +713,7 @@ uwatec_smart_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t alarms[table[id].index] = value; have_alarms = 1; if (table[id].index == 1) { - if (parser->model == ALADINTEC || parser->model == ALADINTEC2G) { - gasmix = (value & 0x18) >> 3; - } else { - gasmix = (value & 0x30) >> 4; - } + gasmix = (value & 0x30) >> 4; } break; case TIME: