fit icon indicating copy to clipboard operation
fit copied to clipboard

include multi-byte bit in base type

Open dudanian opened this issue 2 years ago • 2 comments

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

dudanian avatar Jun 03 '22 18:06 dudanian

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.

dudanian avatar Jun 06 '22 20:06 dudanian

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 avatar Jun 07 '22 10:06 tormoder

@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:

cloudlena avatar Jul 24 '23 07:07 cloudlena

Superseded by #67.

tormoder avatar Oct 01 '23 08:10 tormoder