Skip to content

suunto_nautic: handshake wait on reconnect, trimix, end pressure, /Summary values - #10

Merged
latishab merged 3 commits into
mainfrom
fix/nautic-open-wait-handshake
Oct 11, 2026
Merged

latishab merged 3 commits into
mainfrom
fix/nautic-open-wait-handshake

Conversation

@latishab

Copy link
Copy Markdown
Contributor

Three fixes from the #29 hardware testing.

Open waits for the handshake reply. On a reconnect a few seconds after a drop, the watch is still sending the interrupted /Data stream when the EVA handshake goes out. device_open took the first frame it read (often 0 bytes) as the reply and returned, so the first request went out before the Hello-Ack and the Ocean left it unanswered about two times in three (trustthegoose's frame trace on libdc-swift#29). It now skips frames until the Hello-Ack (0x13) arrives, or carries on once the link goes quiet.

/Summary values. He is an int16 at gas record +3 (the watch's own /Summary schema); it was read as a byte at +2, O2's high byte, so helium was always 0. The water type at 0x3E is exposed as DC_FIELD_SALINITY, and the dive record's average depth and water temperature range are used under the same agreement check as the dive time. On the 13 corpus dives with a Suunto app export they match the app exactly (temperatures to 0.06 °C). One Ocean dive records its minimum above its maximum, so the temperatures are only taken as a sane pair.

End pressure. It was the tank's last reading, but the watch keeps logging on the surface, where a shut and purged regulator reads about 1 bar: kreitje's Nautic S dive 1791129285 ended at 0.9 bar against the app's 121.5 (1763 psi). It is now the last reading while Diving, and the DiveFooter's own end pressure when plausible. The DiveFooter's start pressure isn't used, since it keeps a transmitter's pre-pairing dropout (9.1 bar on 1788683271).

Tests live in libdc-swift (fake watch + capture corpus), in the PR that bumps this submodule.

🤖 Generated with Claude Code

… open

On a quick reconnect the watch is still sending the tail of the stream the
dropped link was reading. device_open took the first frame it read (often
0 bytes) as the handshake response and returned, so the first request went
out before the watch had answered the handshake, and the Ocean dropped it
about two times in three. Skip frames until the Hello-Ack (0x13) arrives,
or continue once the link goes quiet.
…mperatures from /Summary

The gas record holds O2 and He as int16 at +1 and +3 (the watch's own
/Summary schema). He was read as a byte at +2, the high byte of O2, so
helium always came out 0 and trimix decoded as nitrox.

Also expose the water type at 0x3E as DC_FIELD_SALINITY, and take the
diving-only average depth and the water temperature range from the dive
record, as the Suunto app shows them. They are used under the same
agreement check as the dive time; the temperatures only as a sane pair.
… dive

The end pressure was the tank's last reading, but the watch keeps logging
on the surface after the dive, where a shut and purged regulator reads
about 1 bar (1791129285 ended at 0.9 bar against the app's 121.5). Take
the last reading while Diving instead, and the watch's own end pressure
from the DiveFooter's gas records when it is plausible. The DiveFooter's
start pressure isn't used: it keeps a transmitter's pre-pairing dropout.
@latishab
latishab merged commit 3e93d2e into main Oct 11, 2026
18 checks passed
latishab added a commit to deepsealabs/libdc-swift that referenced this pull request Oct 11, 2026
…ter#10

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