I think this would be a good solution. Is there a way to find out if temperature data is not available? Because returning a zero could mean zero degree temperature or that no data is available. Importing a 0°C if it was actually 30°C will cause lots of support requests.
The same goes for the salinity header value. I still would like to suggest adding a dc_water_t.DC_WATER_UNKNOWN flag type as default value, because there are many computers out there which don't support salinity setting. In the end the unavailable data is imported as fresh water instead of "unknown/not set".
Sven
-----Original Message----- From: devel [mailto:devel-bounces@libdivecomputer.org] On Behalf Of Jef Driesen Sent: Monday, August 25, 2014 12:02 AM To: devel@libdivecomputer.org Subject: Re: [PATCH] Added support for parsing temperature in the dive header
For the api, maybe we can stick to the DC_FIELD_TEMPERATURE with a single double value, but use the flag parameter of the dc_parser_get_field function to specify the subtype:
typedef enum dc_temperature_t { DC_TEMPERATURE_SURFACE, DC_TEMPERATURE_MINIMUM, DC_TEMPERATURE_MAXIMUM, } dc_temperature_t;
In the application you would call like this:
dc_parser_get_field (parser, DC_FIELD_TEMPERATURE, DC_TEMPERATURE_XXX, &value);
What do you think?
Jef _______________________________________________ devel mailing list devel@libdivecomputer.org http://libdivecomputer.org/cgi-bin/mailman/listinfo/devel