Garmin support: ignore FIT files that aren't dives

Dirk Hohndel dirk at hohndel.org
Tue Sep 4 15:00:12 PDT 2018


> On Sep 4, 2018, at 7:38 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>> Patch looks fine to me. Not optimal, but not wrong.
>> 
>> Note that doing this right, you should also be able to do do the
>> DC_EVENT_DEVINFO event from the downloader (just once), since you'd
>> have the firmware/serial info now.

Here are a couple more commits, let me know what you think.
Things to note:

- the FIT file format has a TON of redundant information. I /think/ I found
the most relevant message to get us serial/firmware/product
- in order to do that, my code makes the assumption that in the device_info
message the device_index will always be included before the other elements;
this has been the case in all records that I've seen, but I'm not sure that this
is guaranteed. So that's a potential concern with the "reading this as a stream"
approach. Is there a hook that get's called when a message is completed, so
when all fields are read? That would be the safer way to make sure we pick
the correct device_info.
- in the FIT file, the Descent Mk1 is identified as product 2859; I think this would
make sense to use as model number (instead of 0)

Comments? Thoughts?

I'm doing this on a Mac and this one isn't set up to send git email. And as we
saw yesterday attaching patches is suboptimal as well... So instead I pushed 
this to a git repo: 
https://github.com/dirkhh/libdivecomputer-for-linus/commits/Subsurface-NG

/D


More information about the subsurface mailing list