Skip to content

import: read a Suunto Nautic/Ocean .bin in the file-import wizard - #4

Merged
urbamax merged 1 commit into
suunto-nauticfrom
feat/import-dive-computer-raw
Sep 8, 2026
Merged

urbamax merged 1 commit into
suunto-nauticfrom
feat/import-dive-computer-raw

Conversation

@urbamax

@urbamax urbamax commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

What

Import a raw Suunto Nautic-generation (Nautic, Ocean) dive-log file through the existing Import data wizard — same single entry point as every other file format, with automatic format detection and no separate menu, redirect or extra step.

A Bluetooth download from these watches stores its log as concatenated SBEM0103 records ([profile][/Summary] per dive). This PR:

  • FormatDetector recognises the SBEM0103 magic → ImportFormat.suuntoNauticRaw (SourceApp.suunto, confidence 1.0).
  • RawLogFileReader splits the file into its SBEM0103 records.
  • RawLogImportService greedily groups the profile + /Summary record pair per dive, parses it with the same native libdivecomputer call a live BLE download uses, and gates each result on RawProfileSanityCheck before mapping to DownloadedDive.
  • RawDiveComputerParser flattens each dive into the maps UddfEntityImporter already persists → profile, tanks, gas mixes, deco model (GF), pO2 and GPS all import with no Nautic-specific code downstream.

Notes

  • The watch's own event wording is carried as a labelled bookmark; deco stop / safety stop / ceiling additionally get their typed marker. The driver's t=0 initial-gas SAMPLE_EVENT_GASCHANGE is dropped (real switches come through gasSwitches).
  • The computer registers as Suunto / Nautic, no serial: the .bin has no /Info record, so there is no watch serial or firmware in the file. A truncated/guessed serial is worse than none. Device identity for a file import can be filled from the Suunto cloud import instead; a BLE download still gets the real serial from the advertised name.

Tests

  • Native golden (test_parse_suunto_nautic): parses a committed real dive fixture (suunto_nautic_dive.bin) end to end — depth, duration, dive mode, deco model, GF, gas mix, tank pressures.
  • Dart: RawLogFileReader, RawLogImportService (grouping, multi-dive, unrecognised input), RawDiveComputerParser (payload shape, dropped t=0 gaschange, error paths), FormatDetector (SBEM0103 -> suuntoNauticRaw), enum wiring.

🤖 Generated with Claude Code

@urbamax urbamax changed the title Import a raw Suunto Nautic/Ocean dive-log file (parsing layer) Import a raw Suunto Nautic/Ocean dive-log file Sep 8, 2026
@urbamax
urbamax force-pushed the feat/import-dive-computer-raw branch 2 times, most recently from c7bd7c7 to 4d0683c Compare September 8, 2026 13:06
…t wizard

A Bluetooth download from a Nautic-generation watch (Nautic, Ocean) stores
its raw log as concatenated SBEM0103 records. This teaches the universal
"Import data" wizard to recognise such a file and read it with no separate
menu, redirect or extra click: FormatDetector spots the SBEM0103 magic and
returns ImportFormat.suuntoNauticRaw, and RawDiveComputerParser runs the
same native libdivecomputer parse a live download runs, then flattens each
dive into the maps UddfEntityImporter already persists -- so profile,
tanks, gas mixes, deco model and GPS all import with no Nautic-specific
code downstream.

- RawLogFileReader splits a file into its SBEM0103 records.
- RawLogImportService greedily groups the [profile][/Summary] record pair
  per dive, parses it natively, and gates the result on
  RawProfileSanityCheck before mapping to DownloadedDive.
- The watch's own event wording is carried as a labelled bookmark; deco
  stop / safety stop / ceiling also get their typed marker. The driver's
  t=0 initial-gas SAMPLE_EVENT_GASCHANGE is dropped -- real switches come
  through gasSwitches.
- The computer registers as "Suunto / Nautic" with no serial: the .bin
  has no /Info record, and a truncated or guessed serial is worse than
  none (the Bluetooth path still gets the real serial from the BLE name).

Native golden coverage (test_parse_suunto_nautic) parses a committed real
dive fixture end to end; Dart tests cover the reader, the service, the
parser and the format detector.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@urbamax
urbamax force-pushed the feat/import-dive-computer-raw branch from 7dde73f to 64bded8 Compare September 8, 2026 17:36
@urbamax urbamax changed the title Import a raw Suunto Nautic/Ocean dive-log file import: read a Suunto Nautic/Ocean .bin in the file-import wizard Sep 8, 2026
@urbamax
urbamax merged commit 73674cf into suunto-nautic Sep 8, 2026
12 checks passed
@urbamax
urbamax deleted the feat/import-dive-computer-raw branch September 8, 2026 18:10
urbamax added a commit that referenced this pull request Sep 8, 2026
PR #4 landed on suunto-nautic after this sync branched from cd3a010.
Clean merge -- the raw-import wizard files don't overlap the upstream
v1.7.8 changes. 1358 dive_computer/import_wizard tests pass.
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