Repository navigation
suunto_nautic: download complete dives and every listed entry - #5
Merged
Merged
Conversation
- Read the /Data stream until it goes quiet instead of stopping at 4096 frames (~1.14 MB), which cut the end off most real dives; keep 65536 frames only as a runaway guard. (libdc-swift #60) - Close every stream with STREAM_STOP and drain to STREAM_END, so the next request isn't answered by a leftover chunk. Retry a stream the watch refuses (non-200 stream start, e.g. 423 Locked). - Accept a GET's reply only when it is an ACK (0x02/0x03) echoing the request's message id; never take a handle from another frame. (#59) - Strip the 11-byte page header and 4-byte CRC from each /Summary page and advance the offset by data bytes, as the watch counts it. (#57) - Follow /Logbook/Entries pages with the uint32 StartAfterId parameter; the list is oldest-first, so page 1 alone dropped the newest dives. (#61) - Check each download against its listed size (= compressed /Data + /Summary data bytes): retry once on a mismatch, then warn and deliver in foreach, or return DC_STATUS_DATAFORMAT with the data kept from suunto_nautic_device_download(). (#58) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
make distcheck failed with 'libdivecomputer/suunto_nautic.h' file not found because the header was missing from the installed header list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes the Nautic/Ocean transport issues reported by @trustthegoose on libdc-swift:
/Datastream stopped at 4096 frames (~1.14 MB compressed), cutting off the ascent, safety stop and surfacing of most normal-length dives. It now reads until the stream goes quiet; 65536 frames stays as a runaway guard only.STREAM_STOP(drained toSTREAM_END), and a GET's reply is accepted only as an ACK (0x02/0x03) echoing the request's message id. A leftover0x01chunk can no longer be taken as the/SummaryACK, which addressed the wrong handle and got a 404. A refused stream (non-200 stream start, e.g. 423) is retried./Summarypage is[header:11][data][crc:4]; only the data is kept and the offset advances by data bytes, so the 15 bytes at each page boundary are no longer lost./Logbook/Entriesis paged oldest-first; later pages are fetched with the uint32StartAfterIdparameter (01 | 07 00 | id), so the newest dives are listed and the fingerprint walk finds page-2 dives./Data+/Summarydata bytes). A mismatch is retried once;foreachthen delivers the dive with a warning (skipping it would move the fingerprint past a dive no later sync could fetch), andsuunto_nautic_device_download()returnsDC_STATUS_DATAFORMATwith the data still in the buffer.Tested in libdc-swift against a scripted fake watch over
dc_custom_open(newSuuntoNauticTransportTests): a 1.2 MB dive,/Summarypaging offsets, leftover chunks before the ACK, a 423 refusal, 23 entries over two pages, a page-2 fingerprint, and a short download. All fail on the previous driver and pass here. Not yet run against a physical watch.🤖 Generated with Claude Code