There's a minor bug in the Resolutionable code where encoding a value then decoding it doesn't result in the original value. This affects certain fields with an offset such as altitude/enhanced_altitude. Fields without offsets are unaffected.
This is because the offset is added last when encoding, but removed last when decoding.
If I opened my fit files in other tools I saw the incorrect decoded value which suggested it was a problem with the encoding of the data.
Looking at the FIT protocol it appears the encoding logic should add the offset first, then multiply by the scale factor. This will give the original value after decoding.
There's a minor bug in the Resolutionable code where encoding a value then decoding it doesn't result in the original value. This affects certain fields with an offset such as altitude/enhanced_altitude. Fields without offsets are unaffected.
This is because the offset is added last when encoding, but removed last when decoding.
e.g. current implementation:
If I opened my fit files in other tools I saw the incorrect decoded value which suggested it was a problem with the encoding of the data.
Looking at the FIT protocol it appears the encoding logic should add the offset first, then multiply by the scale factor. This will give the original value after decoding.