DiveSystem: Handle APOS5 sample record alias fix. - #122
Open
zorcik wants to merge 1 commit into
Open
Conversation
Signed-off-by: Jacek Partyka <j.partyka@weblogic.pl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adressing libdivecomputer/libdivecomputer#68
Summary
Firmware 50211016 changed the record type field in sample records, causing libdivecomputer to skip all dive samples (treating them as non-sample metadata records). This results in 0m depth and 0min time for every imported dive.
Root Cause
The sample record type field at byte offset 52 (a
uint16_le) changed its value for ordinary profile samples:0x0000REC_SAMPLE✅ → parsed0x800EWhat happens in the code
In [divesystem_idive_parser.c]:
A previous fix already mapped
0x8006(REC_SAMPLE_APOS5_COMPAT) →REC_SAMPLEfor APOS5 firmware. But firmware 50211016 now uses0x800Einstead, which is not handled.Solution
Check only higher bit of the sample (0x80)