Implement the salinity field

This commit is contained in:
Jef Driesen 2017-08-16 20:38:47 +02:00
parent 722160cd48
commit 854ad13f16

View File

@ -173,6 +173,7 @@ divesystem_idive_parser_get_field (dc_parser_t *abstract, dc_field_type_t type,
}
dc_gasmix_t *gasmix = (dc_gasmix_t *) value;
dc_salinity_t *water = (dc_salinity_t *) value;
if (value) {
switch (type) {
@ -197,6 +198,10 @@ divesystem_idive_parser_get_field (dc_parser_t *abstract, dc_field_type_t type,
*((double *) value) = array_uint16_le (data + 11) / 1000.0;
}
break;
case DC_FIELD_SALINITY:
water->type = data[34] == 0 ? DC_WATER_SALT : DC_WATER_FRESH;
water->density = 0.0;
break;
case DC_FIELD_DIVEMODE:
if (parser->divemode == 0xFFFFFFFF)
return DC_STATUS_UNSUPPORTED;