Skip to content

suunto_nautic: download complete dives and every listed entry - #5

Merged
latishab merged 2 commits into
mainfrom
fix/nautic-complete-downloads
Oct 4, 2026
Merged

latishab merged 2 commits into
mainfrom
fix/nautic-complete-downloads

Conversation

@latishab

@latishab latishab commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the Nautic/Ocean transport issues reported by @trustthegoose on libdc-swift:

Tested in libdc-swift against a scripted fake watch over dc_custom_open (new SuuntoNauticTransportTests): a 1.2 MB dive, /Summary paging 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

latishab and others added 2 commits October 4, 2026 16:43
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant