[PATCH] Add average depth from OSTC/OSTC3 logbook
Jef Driesen
jef at libdivecomputer.org
Wed Jan 21 01:39:57 PST 2015
On 2015-01-21 09:59, Anton Lundin wrote:
> On 21 January, 2015 - Jef Driesen wrote:
>
>> On 2015-01-21 08:38, Anton Lundin wrote:
>> > static const hw_ostc_layout_t hw_ostc_layout_ostc = {
>> > 3, /* datetime */
>> > 8, /* maxdepth */
>> >+ 45, /* avgdepth */
>> > 10, /* divetime */
>> > 15, /* atmospheric */
>> > 43, /* salinity */
>> >@@ -121,6 +123,7 @@ static const hw_ostc_layout_t hw_ostc_layout_ostc = {
>> > static const hw_ostc_layout_t hw_ostc_layout_frog = {
>> > 9, /* datetime */
>> > 14, /* maxdepth */
>> >+ UNSUPPORTED, /* avgdepth */
>> > 16, /* divetime */
>> > 21, /* atmospheric */
>> > 43, /* salinity */
>>
>> This fails to compile because UNSUPPORTED isn't defined. According to
>> the
>> frog documentation the average depth is stored at offset 45, just like
>> the
>> ostc.
>>
>
> Ah, thats because the UNSUPPORTED flag only exists in the subsurface
> branches, and if its at offset 45 it can easily be fixed.
>
> Btw. From where have you gotten any frog documentation? Have you gotten
> it straight from HW? As far as i know, none have bin published, at
> least
> not on bitbucket where i've found the OSTC{2,3} documentation.
Yes, I got the documentation from HW. As far as I know it has never been
published.
>> PS: The average depth field is not implemented for any backend. I
>> added the
>> field because I thought it made sense at that time. But most
>> applications
>> seem to prefer to calculate avg depth from the profile (which has the
>> advantage of being able to take into account preferences like ignore
>> shallow
>> samples, etc), so I just never bothered to implement this.
>
> Yea, i saw the field when i dug around in the OSTC{2,3} documentation
> to
> try to figure out other things, so i thought id implement it.
>
> When i check, the eonsteel backed actually implements it.
>
> Maybe it should raise some deprecation warning in dc_parser_get_field?
Well, I'm not really sure whether we should deprecate it or not. It
might still be useful for someone. I just mentioned this in case you
were wondering why it's not implemented in any other backend (with the
exception of the eonsteel) :-)
Jef
More information about the devel
mailing list