From 74fcd11d2bc492c066da4bd097d455c281c42b81 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sat, 16 May 2015 22:57:09 +0200 Subject: [PATCH] Add support for the salinity field. --- src/uwatec_smart_parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index 88ed34e..86cf097 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -522,6 +522,7 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi dc_gasmix_t *gasmix = (dc_gasmix_t *) value; dc_tank_t *tank = (dc_tank_t *) value; + dc_salinity_t *water = (dc_salinity_t *) value; if (value) { switch (type) { @@ -582,6 +583,12 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi else *((dc_divemode_t *) value) = DC_DIVEMODE_GAUGE; break; + case DC_FIELD_SALINITY: + if (table->salinity == UNSUPPORTED) + return DC_STATUS_UNSUPPORTED; + water->type = parser->watertype; + water->density = salinity * 1000.0; + break; default: return DC_STATUS_UNSUPPORTED; }