Repository navigation
suunto_nautic: send and receive packets through one layer, and verify them - #14
Merged
Merged
Conversation
… them The transport from the upstream PR (libdivecomputer/libdivecomputer#73), reworked after Jef's review: every reply is checked (start byte, length, CRC) and matched by opcode and sequence number, so the replies to the Suunto app's requests on the same link are skipped instead of taken as ours. The /Data stream ends on its end marker with each chunk's offset checked, and /Logbook/Entries is parsed by its records. The extension API is rebuilt on the same layer, with the same outputs: request/fetch/fetch_raw return the reply packets as before. Unlike upstream, the open carries on without a reply to the hello and flags it, so the apps can tell the diver the watch may be asleep, and the sequence numbers carry on from the previous connection.
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.
The transport from the upstream PR (libdivecomputer/libdivecomputer#73), reworked after Jef's review comments there.
0x07PUT replies) are skipped by sequence number instead of being taken as ours. That's the Sep 23 field failure: the old driver read a Hello reply as its GET ACK and fetched a garbage handle.The extension API is rebuilt on the same layer with the same outputs (
request/fetch/fetch_rawreturn the reply packets as before). Two fork-only behaviours are kept: the open carries on without a hello reply and flags it (the sleeping watch hint), and sequence numbers continue across connections.Testing
LibDCSwift-Packagetests: 123 run, 0 failures, including the 33 fake-watch transport tests, whose fake now frames packets like a real watch (real CRCs, stream offsets, end marker).DC_STATUS_TIMEOUT, as in the field.🤖 Generated with Claude Code