From c135eb75de747500a9aef06f3b4323f7b94d59df Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 9 Mar 2015 10:42:16 +0100 Subject: [PATCH] Implement the dive mode field. Dives with all gas mixes disabled are flagged as gauge dives in the Uwatec application. --- src/uwatec_smart_parser.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index cf2b2c7..3cd19bf 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -480,6 +480,14 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi return DC_STATUS_UNSUPPORTED; *((double *) value) = (signed short) array_uint16_le (data + table->temp_surface) / 10.0; break; + case DC_FIELD_DIVEMODE: + if (parser->trimix) + return DC_STATUS_UNSUPPORTED; + if (parser->ngasmixes) + *((dc_divemode_t *) value) = DC_DIVEMODE_OC; + else + *((dc_divemode_t *) value) = DC_DIVEMODE_GAUGE; + break; default: return DC_STATUS_UNSUPPORTED; }