Fix the average depth for older OSTC dives

For older OSTC dives, using logbook format version 0x20, the average
depth is not available in the dive header. It's only available since
version 0x21, which increased the header size from 47 to 57 bytes.
This commit is contained in:
Jef Driesen 2018-08-09 23:49:25 +02:00
parent aee70d1ec7
commit 17b3e07398

View File

@ -465,6 +465,8 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
*((double *) value) = array_uint16_le (data + layout->maxdepth) / 100.0;
break;
case DC_FIELD_AVGDEPTH:
if (parser->version < 0x21)
return DC_STATUS_UNSUPPORTED;
*((double *) value) = array_uint16_le (data + layout->avgdepth) / 100.0;
break;
case DC_FIELD_GASMIX_COUNT: