Add Suunto Nautic / Ocean (Vaasa) BLE support + CI build fix - #1
Merged
Merged
Conversation
Add support for the Suunto Nautic / Ocean ("Vaasa" generation) BLE dive
computers.
The driver speaks the HDLC-framed RPC protocol over BLE: path-addressed
GET requests, a stream-fetch download of the dive data, and a short
0x0D fetch for the logbook listing. Dives are enumerated from
/Logbook/Entries (each LogId is a UNIX timestamp) and downloaded
newest-first through the standard dc_device_foreach() interface. Each
dive is a sequence of MDS-wrapped, Heatshrink (LZSS) compressed blocks
that decode to an SBEM0103 container; a vendored copy of the Heatshrink
decoder lives in src/heatshrink/.
Registers the DC_FAMILY_SUUNTO_NAUTIC family, the descriptor table
entries and BLE name filter, and the device_open dispatch.
Parse the SBEM0103 TLV stream from a downloaded Suunto Nautic / Ocean dive into libdivecomputer fields and samples. Decodes depth, temperature, absolute and surface pressure, cylinder pressures, NDL and time-to-surface, GPS, gradient factors and gas mixes, and dive events. The sample clock is delta-encoded per chunk; the dive start time is reconstructed from the absolute UTC carried in GPS fixes. Series libdivecomputer has no sample type for (battery, GPS accuracy, 9-axis IMU, dive-route features) are emitted through DC_SAMPLE_VENDOR tagged SAMPLE_VENDOR_SUUNTO_NAUTIC. The TLV walk resynchronises past localized Heatshrink decompression artifacts by validating fixed-length chunk ids against their expected length.
The Android and MSVC project files are maintained by hand and were not updated when the Suunto Nautic driver was added, so the Android and Visual Studio CI jobs failed to build the new sources. Add suunto_nautic.c, suunto_nautic_parser.c and the bundled heatshrink decoder to contrib/android/Android.mk and contrib/msvc/libdivecomputer.vcxproj, and include <stdint.h> in suunto_nautic_parser.c which uses the fixed-width integer types directly. Co-Authored-By: Claude Sonnet 5 <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.
Brings Suunto Nautic / Ocean ("Vaasa" generation) BLE support into this fork, plus the build-file changes needed for the Android and Visual Studio CI jobs to compile the new sources.
Commits
src/heatshrink/, registration ofDC_FAMILY_SUUNTO_NAUTIC.contrib/android/Android.mk) and MSVC (contrib/msvc/libdivecomputer.vcxproj) project files were not updated when the driver landed: addsuunto_nautic.c,suunto_nautic_parser.cand the heatshrink decoder. Also add#include <stdint.h>tosuunto_nautic_parser.c, which uses the fixed-width integer types directly. The autotools build (src/Makefile.am) already listed the sources.Testing
autoreconf --install --force && ./configure && make.cast-qualinsuunto_nautic.c:432), not introduced by these commits.Related to deepsealabs/libdc-swift#29. Reuses the commits from libdivecomputer#73.