From 7a108f555bc541a5343bbf6635c0181a208930ef Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 1 Oct 2014 15:28:37 -0700 Subject: [PATCH] Aeris A300CS: add reporting of water type (fresh/salt) Signed-off-by: Dirk Hohndel --- src/oceanic_atom2_parser.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 3abbae0..6983be7 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -333,6 +333,7 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns } dc_gasmix_t *gasmix = (dc_gasmix_t *) value; + dc_salinity_t *water = (dc_salinity_t *) value; unsigned int oxygen = 0; unsigned int helium = 0; @@ -379,6 +380,18 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns gasmix->oxygen = (oxygen ? oxygen / 100.0 : 0.21); gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium; break; + case DC_FIELD_SALINITY: + if (parser->model == A300CS) { + if (data[0x18] & 0x80) { + water->type = DC_WATER_FRESH; + } else { + water->type = DC_WATER_SALT; + } + water->density = 0.0; + } else { + return DC_STATUS_UNSUPPORTED; + } + break; default: return DC_STATUS_UNSUPPORTED; }