Disable gas change events except for the intial mix.

For the IQ-700, the existing code for the active gas mix always results
in an out-of-range gas mix index. The index of the active gas mix is
probably stored in another bit. As a temporary workaround, we simply
assume the active gas mix is always the first gas mix. This should
already produce correct results for dives with only single gas mix.
This commit is contained in:
Jef Driesen 2015-04-18 20:17:52 +02:00
parent 311bc85645
commit 47874037ea

View File

@ -217,8 +217,12 @@ cressi_edy_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c
// Current gasmix
if (ngasmixes) {
unsigned int idx = (data[offset + 0] & 0x60) >> 5;
if (idx >= ngasmixes)
if (parser->model == IQ700)
idx = 0; /* FIXME */
if (idx >= ngasmixes) {
ERROR (abstract->context, "Invalid gas mix index.");
return DC_STATUS_DATAFORMAT;
}
if (idx != gasmix) {
sample.event.type = SAMPLE_EVENT_GASCHANGE;
sample.event.time = 0;