Closed dudanian closed 1 year ago
I updated this to use internal structs and a switch to group the data instead of a bunch of parallel arrays. I found this to be much easier to reason through. I also replaced the bit logic with a decompress func so we don't deal with semi-valid Base
variables. It should hold the same nil safety as the previous work (the previous code would index OOB error on invalid usage and this will nil pointer except on invalid usage). This latest commit is a much bigger refactor than before and am open to reverting it.
Hi. Thanks for looking into this. I'll try to take a look soon.
May I ask you to split the two approaches into two separate PRs?
@tormoder, have you already had time to look into these PRs? I think, they would actually fix https://github.com/tormoder/fit/issues/69 :rocket:
Superseded by #67.
The most-significant bit in the base type field is set on data types which are larger than 1 byte. While this bit isn't terribly important when parsing a fit file (and is all but ignored currently), it should still be set when exporting a fit file to prevent writing invalid base data types.
The updated values can be found here under
Table 7. FIT Base Types and Invalid Values