Skip to content

suunto_nautic: decode multi-gas mixes and link tanks to gas + volume - #1

Merged
latishab merged 1 commit into
mainfrom
fix/nautic-multigas-tank-linkage
Sep 5, 2026
Merged

suunto_nautic: decode multi-gas mixes and link tanks to gas + volume#1
latishab merged 1 commit into
mainfrom
fix/nautic-multigas-tank-linkage

Conversation

@latishab

@latishab latishab commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The /Summary gas table is a 45-byte-stride array (base 0xC7), one record per configured gas: O2% at +1, He% at +2, PO2-max float at +5, cylinder water capacity float (m³) at +9. The previous 4-byte stride only ever recovered the first gas (the PO2 float after gas 0 tripped the plausibility stop), so multi-gas dives lost every mix after the first and tanks were never linked to a gas.

This parses gases at the correct stride, stores each gas's cylinder volume, tags every tank with its cylinder-slot index (== GasNumber), and wires tank->gasmix plus DC_TANKVOLUME_METRIC volume in DC_FIELD_TANK.

Reverse-engineered and validated against two real dual-transmitter dives (Air 12 L on gas 0 + NX26 5.7 L on gas 1, deepsealabs/libdc-swift#29): both mixes, per-tank gas linkage, and volumes match the Suunto app export exactly. Resolves the multi-gas half of deepsealabs/libdc-swift#33/#34. Single-gas and profile-only captures are unaffected (stop at the first implausible slot, as before).

🤖 Generated with Claude Code

The /Summary gas table is a 45-byte-stride array (base 0xC7), one record
per configured gas: O2% at +1, He% at +2, PO2-max float at +5, cylinder
water capacity float (m^3) at +9. The previous 4-byte stride only ever
recovered the first gas because the PO2 float after gas 0 tripped the
plausibility stop, so multi-gas dives lost every mix after the first and
tanks were never linked to a gas.

Parse gases at the correct stride, store each gas's cylinder volume, tag
every tank with its cylinder-slot index (== GasNumber), and wire
tank->gasmix plus DC_TANKVOLUME_METRIC volume in DC_FIELD_TANK.

Reverse-engineered and validated against two real dual-transmitter dives
(Air 12 L on gas 0 + NX26 5.7 L on gas 1): both mixes, per-tank gas
linkage, and volumes now match the Suunto app export exactly. Resolves the
multi-gas half of issues #33/#34; single-gas and profile-only captures are
unaffected (stop at the first implausible slot, as before).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012VH1Magk9E9nWusjYQd4oe
@latishab
latishab merged commit 64e9ce4 into main Sep 5, 2026
6 of 18 checks passed
urbamax added a commit to urbamax/submersion that referenced this pull request Sep 7, 2026
deepsealabs/libdivecomputer#1 cherry-picked onto submersion-patches: the
/Summary gas table is a 45-byte-stride array (base 0xC7), not 4-byte, so
the old parser stopped after gas 0 (it hit the PO2 float) and lost every
mix on a multi-gas Nautic dive; tanks were never linked to a gas. Now each
tank carries its gas index and per-gas cylinder volume.

Also reconciles the earlier standalone cylinder-size read (bb1aa55) --
superseded by the per-gas volume -- and rebases the PO2-max read (bcd0542)
onto Gas[0]+5.

Single-gas dives, including every one in the local corpus, are unchanged.

Co-Authored-By: Claude Sonnet 5 <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