From 42808873e469a80915ad382205dca53c9f7ffd42 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 17 Mar 2015 19:57:06 +0100 Subject: [PATCH] Disable alarm based gas switches for the Meridian. The gas mix index stored in the alarm bytes is occasionally out of range (larger than the number of available gas mixes). The index refers to one of the disabled gas mixes. Since those are excluded now, this results in a fatal error instead of a switch to a nonsense gas mix. To workaround this problem, the alarm based gas switches are disabled until we figure out how to parse them correctly. The Chromis is almost identical to the Meridian, and will probably need the same workaround. Although I don't have any data to confirm this, let's just keep the two in sync. --- src/uwatec_smart_parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index 3cd19bf..9835d3e 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -727,7 +727,9 @@ 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) { - gasmix = (value & 0x30) >> 4; + if (parser->model != MERIDIAN && parser->model != CHROMIS) { + gasmix = (value & 0x30) >> 4; + } } break; case TIME: