Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Heinrichs Weikamp OSTC logbook and profile format

This document describes the dive record that all Heinrichs Weikamp computers return: a dive header followed by a variable-length profile. One family of formats covers every model. The profile version byte selects the header layout. The profile is a stream of samples: depth, then a flag byte that gives the number of extra bytes, optional event bytes, then optional “extended information” fields whose presence is governed by per-field divisors. The transport side is in hw-ostc-legacy.md (OSTC, Mk2, 2N, 2C, Frog) and hw-ostc3.md (hwOS and OSTC 4/5).

All multi-byte integers are little-endian unless stated otherwise.

Profile versions

VersionDevicesHeader sizeWhere the version byte sitsTime storedDivisor table
20OSTC, Mk2 (early firmware)47header offset 2end of dive6 nibble bytes in header
21OSTC Mk2, 2N, 2C57header offset 2end of dive6 nibble bytes in header
22Frog256header offset 8end of dive6 nibble bytes in header
23hwOS (OSTC 3, Plus, 2, Sport, cR, …) older firmware256header offset 8end of diveprofile small header
24hwOS newer firmware, all OSTC 4/5 dives256header offset 8start of diveprofile small header

A parser MUST select the version byte position from the device family: offset 2 for the OSTC/Mk2/2N/2C dump format, offset 8 for Frog and hwOS. Any other version value is unknown and MUST be rejected. The OSTC 4/5 always reports 24 over the wire. Its internal version is 30. Entries of any other internal version are reported as FF.

Confidence: verified for 21, 23, 24 (vendor firmware sources and interface documents). likely for 20 and 22 (one open-source implementation).

Header layouts

Versions 20 and 21 (OSTC, Mk2, 2N, 2C)

Offsets are relative to the first FA of the header.

OffsetTypeRaw unitMeaning
0FA FAheader start marker
2u8profile version (20 or 21)
3u8 ×5month, day, year−2000, hour, minute: end of dive, local time. The 5 bytes are the fingerprint
8u16mbar (relative, salinity-adjusted)maximum depth. Implementations use value/100 → m
10u16 + u8min, sdive time (excludes very shallow parts)
13i160.1 °Cminimum temperature
15u16mbarsurface pressure 30 min before the dive
17u16mindesaturation time after the dive
195 × (u8, u8)%gas 1-5: O2, He. In CCR mode these are diluents 1-5
29u8, u8%gas 6 (manually set mix): O2, He
31u8initial gas number, 1-5 (FF = none)
32u8, u8firmware major, minor
34u16mV (likely)battery voltage
36u8ssample interval
37u8 ×6divisor bytes for types 0-5 (see Divisors)
43u8salinity: 100-104 meaning 1.00-1.04 kg/l
44u8%CNS at end of dive
45u16mbar (relative)average depth, value/100 → m (version 21. Implementations ignore it for 20)
end of version 20 header (47 bytes)
47u16stotal dive time including shallow parts
49u8, u8%GF low, GF high (GF modes). Otherwise saturation and desaturation multipliers
51u8dive mode / deco model, see below
52u8mlast deco stop depth setting
53u8bit setgases enabled: bit i = gas i+1 active
54u8hon-time since last full charge
55FB FBheader end marker

Dive mode byte (offset 51, version 21):

ValueModeDeco model
0open circuitZH-L16 (GF 100/100)
1gaugenone
2closed circuitZH-L16
3apnea (freedive)none
4open circuitZH-L16-GF (GF from 49/50)
5closed circuitZH-L16-GF
6pSCRZH-L16-GF

For version 20 all five gases count as enabled and there is no mode byte.

Confidence: verified for version 21 field order (vendor Mk2 firmware source). likely for the mode table, the 47-byte version 20 header, battery units and salinity encoding (one open-source implementation).

Version 22 (Frog)

OffsetTypeRaw unitMeaning
0FA FA (likely)header start
2u24addressprofile begin pointer into the profile ring
5u24addressprofile end pointer
8u8profile version 22
9u8 ×5month, day, year−2000, hour, minute (end of dive). Fingerprint
14u16mbarmax depth, value/100 → m
16u16 + u8min, sdive time
19i160.1 °Cminimum temperature
21u16mbarsurface pressure
25u8 at 25, 27, 29%O2 of gases 1-3 (no helium on the Frog)
31u8initial gas number 1-3 (FF = none)
32u8, u8firmware major, minor
36u8ssample interval
37u8 ×6divisor bytes (same encoding as versions 20/21)
43u8salinity 100-104
45u16mbaraverage depth
47u16stotal dive time
49u8, u8%GF low, GF high
51u8mode: 0 ZH-L16 (OC), 1 ZH-L16-GF (OC), 2 apnea
52u16internal dive counter

Confidence: likely (one open-source implementation, no vendor documentation for the Frog).

Versions 23 and 24 (hwOS, OSTC 4/5)

OffsetTypeRaw unitMeaning
0FA FAheader start
2u24addressprofile begin pointer (internal)
5u24addressprofile end pointer (internal)
8u8profile version 23 / 24
9u24bytesprofile length (see hw-ostc3.md for the transfer arithmetic)
12u8 ×5year−2000, month, day, hour, minute. 23 = end, 24 = start of dive. Fingerprint
17u16mbar / cm (salinity included)max depth, value/100 → m
19u16 + u8min, sdive time (excludes parts shallower than 1 m)
22i160.1 °Cminimum temperature
24u16mbarsurface pressure 30 min before the dive
26u16mindesaturation time after the dive
285 × 4 bytesgas or diluent 1-5: O2 %, He %, change depth m, type
482 bytesfirmware: hwOS major, minor. OSTC 4/5 packed u16le (bits 15-11 major, 10-6 minor, 5-1 patch, 0 beta)
50u16mVbattery voltage after the dive
52u8ssample interval (also in the profile small header)
53u16%CNS at start of dive
55u8%GF at start of dive
56u8%GF at end of dive (OSTC 4/5 firmware ≥ 1.7.5: surface GF at end)
57u16configured logbook offset (OSTC 4/5: personal dive count)
59u8hwOS: battery information (undefined). OSTC 4/5: battery charge % (FF = unknown)
605 × (u8, u8)cbar, msetpoint 1-5 and its change depth
70u8%salinity 0-5. Density = (100 + value) × 10 kg/m³
71u16%maximum CNS
73u16mbaraverage depth, value/100 → m
75u16stotal dive time including shallow parts
77u8%GF low (GF model). Otherwise saturation multiplier (OSTC 4/5 VPM: conservatism)
78u8%GF high (GF model). Otherwise desaturation multiplier
79u8deco model: 0 ZH-L16, 1 ZH-L16-GF, 2 VPM (OSTC 4/5)
80u16internal total dive counter at the time of the dive
82u8dive mode: 0 OC, 1 CC, 2 gauge, 3 apnea, 4 pSCR
83u8 ×16minN2 compartment desaturation times
99f32 ×16mbarN2 compartment pressures at end of dive
163u8 ×16minHe compartment desaturation times
179f32 ×16mbarHe compartment pressures at end of dive
243u8mlast deco stop setting (3, 4, 5 or 6)
244u810 cmassumed distance to the shown stop
245u16mVhwHUD battery (0 = no HUD)
247u8bit sethwHUD status: bit 0 link ok, 1 calibrated, 2 HUD battery low, 3-5 sensor 1-3 active, 6 calibrated externally, 7 data from DR5/DRx
2486 bytes10⁻⁹ Asbattery gauge registers (3.6 V battery only. Zero on OSTC 4/5)
254FB FBheader end

Gas type byte: open circuit 0 disabled, 1 first, 2 travel, 3 deco. Diluent 0 disabled, 1 first, 2 normal. The first gas always has change depth 0. In CC and pSCR mode the list holds diluents. The initial gas is the first entry whose type is 1. In CC mode, setpoint 1 (offset 60) is the initial setpoint.

Depth units: the vendor documents describe the max depth as “centimetres” (2019) and as “mbar” (2025). Both say salinity is included. The average depth is “mbar”. Implementations divide both by 100 to get metres. See open questions.

Confidence: verified (vendor interface documents and OSTC 4 firmware source). likely for pSCR mode 4 (one implementation) and the OSTC 4/5 meaning of offsets 56 and 59 (firmware source plus one implementation).

Compact header (16 bytes, hwOS command 6D)

OffsetTypeMeaning
0u24profile length (same value as full header offset 9)
3u8 ×5year−2000, month, day, hour, minute (fingerprint)
8u16max depth (as full header offset 17)
10u16 + u8dive time min, s
13u16internal dive counter
15u8profile version (FF on firmware older than 1.92)

An unused entry is 16 × FF.

Confidence: verified (vendor documents, OSTC 4 source).

Profile

hwOS small header (versions 23, 24)

The profile that follows the 256-byte header begins with:

OffsetTypeMeaning
0u24profile length
3u8sample interval, s
4u8N = number of divisor entries
5 + 3ku8, u8, u8entry k: type, size in bytes, divisor

Samples start at offset 5 + 3N. Firmware so far writes N = 7, one entry per type 0-6 in type order. The vendor reserves later entries for future types, so a parser SHOULD accept any N and identify entries by their type byte, not their position. Existing implementations cap N at 7.

The vendor tells hosts to use the interval “from the dive header”. Implementations use the small-header interval at offset 3. Both values are written from the same setting.

Older layouts (versions 20, 21, 22)

There is no small header. The interval is header offset 36. Offsets 37-42 hold one byte per type 0-5 in type order. Bits 0-3 are the divisor (0 = never), bits 4-7 the field size. Samples start right after the header.

Divisors and extended information

Samples are numbered from 1. Field t is present in sample n exactly when its divisor d ≠ 0 and n mod d = 0.

TypeFieldSizeEncodingVendor default divisor
0temperature2i16, 0.1 °C6
1deco / NDL2byte 0: 0 = within no-deco limit, else first stop depth in m. Byte 1: NDL minutes, or length of first stop in minutes6
2gradient factor1u8, current GF %12 (OSTC 4/5: 0)
3ppO2 sensors3 or 9size 3 (Mk2): one u8 per sensor, 0.01 bar (the Mk2 writes zeros). Size 9 (hwOS): per sensor u8 ppO2 in 0.01 bar + u16 cell voltage in 0.1 mV2 (0 in OC dives)
4deco plan15u8 × 15: stop lengths in minutes for 15 stop levels. The Mk2 orders them 3 m … 45 m in 3 m steps. On hwOS the vendor points to the last-stop setting (header offset 243: 3-6 m). The exact level mapping is uncertain12
5CNS1 or 2size 1 (Mk2): u8 %. Size 2 (hwOS): u16 %12
6tank pressure2u16, active gas tank pressure, see below15 (OSTC 4/5: 30 or 0)

Implementations check the sizes: temperature, deco and tank must be 2. ppO2 must be 3 or 9. CNS must be 1 or 2.

Tank pressure unit: the 2019 vendor document says 0.1 bar. The OSTC 4/5 writes the sensor value in bar, and its document says “not used yet”. The reference implementation treats the value as bar, except hwOS Sport firmware 10.40-10.50, which it treats as 0.1 bar. The value 0 means “no reading”. The value belongs to the tank of the currently active gas.

Sample layout

u16    depth            (relative pressure, mbar, salinity NOT applied; value/100 → m)
u8     flag             bits 0-6: number of bytes that follow in this sample (0-127)
                        bit 7: at least one event byte follows
[event bytes]           only if flag bit 7
[event payloads]        in the fixed order below
[extended fields]       types in table order, each only when its divisor fires
[setpoint, bailout]     versions 20/21/22 only, see below
[unknown trailing bytes]   skip: the count in the flag byte is authoritative

The profile ends with FD FD, which must follow the last sample exactly. A profile of exactly FD FD, or the 5-byte form 08 00 00 FD FD (length field 8, end marker), contains no samples.

Sample n (1-based) is at time n × interval seconds after dive start.

Event bytes

Event byte 1:

BitsMeaning
0-3alarm: 0 none, 1 ascent too fast (“SLOW”), 2 deco stop missed, 3 deep stop missed (Mk2. hwOS: unused), 4 ppO2 low, 5 ppO2 high, 6 manual marker (bookmark), 7 low battery
4manual gas set (“gas 6”): 2 payload bytes
5gas change: 1 payload byte
6setpoint change: 1 payload byte
7versions 23/24: another event byte follows. Versions 20/21: bailout (2 payload bytes)

Event byte 2 (versions 23/24, present when bit 7 of byte 1 is set):

BitMeaningPayload
0switched to bailout2 bytes
1compass heading (OSTC 4/5)2 bytes
2GNSS position (OSTC 4/5)8 bytes
3scrubber state (OSTC 4/5)2 bytes
4-6unused
7another event byte follows

Later event bytes follow the same chaining rule. Treat event byte k (0-based) as bits 8k..8k+7 of one event word.

Payload order (versions 23/24). Payloads follow all event bytes:

  1. manual gas set (byte 1 bit 4): O2 %, He %. A new mix not in the header list.
  2. gas change (byte 1 bit 5): u8 gas number, 1-based into the header gas list. On the OSTC 4/5 in CC mode, numbers 6-10 mean diluent 1-5 (see variations).
  3. setpoint change (byte 1 bit 6): u8, cbar.
  4. bailout (byte 2 bit 0): O2 %, He % of the open-circuit bailout gas.
  5. compass heading (byte 2 bit 1): u16. Bits 0-8 heading in degrees, bit 14 “set as new reference heading”, bit 15 “heading cleared” (bits 0-8 then meaningless).
  6. GNSS position (byte 2 bit 2): f32 longitude, then f32 latitude (IEEE 754, little-endian).
  7. scrubber state (byte 2 bit 3): u16. Bits 0-11 remaining scrubber time in minutes as a signed 12-bit value (negative = overdue), bit 13 warning (< 30 min), bit 14 error (< 0 min).

Then the extended fields follow.

Versions 20, 21, 22: a single event byte. Its payloads are: manual gas (bit 4, 2 bytes) and gas change (bit 5, 1 byte). Then the extended fields. After the extended fields come setpoint change (bit 6, 1 byte) and bailout (bit 7, O2 %, He %). The vendor firmware comment says the setpoint was appended at the end for compatibility.

Confidence: verified for sample layout, event bits, payload order and extended field encodings (vendor documents and Mk2/OSTC 4 firmware sources). likely for alarm value 3 on the Mk2, scrubber sign extension and the tank pressure unit handling (one implementation).

Worked example

Vendor example. The divisors are temperature 3, deco 1, all others 0, so N = 7 with only these two non-zero.

64 00 02 00 A0             depth 100 → 1.00 m; 2 bytes follow; deco: NDL 160 min
C8 00 02 00 A0             depth 2.00 m; NDL 160 min
2C 01 04 32 00 00 A0       depth 3.00 m; 4 bytes; temperature 0x0032 = 5.0 °C; NDL 160 min
5E 01 84 21 02 00 9F       depth 3.50 m; 4 bytes + event; event 0x21 = alarm 1 (ascent)
                           + gas change; gas 2; NDL 159 min
FD FD                      end of profile

In sample 3, 3 mod 3 = 0, so the temperature is present. In sample 4 the order is: event byte, gas change payload, then the deco field. These values were re-parsed with a fresh script and the flag-byte counts match.

Date and time

Local wall-clock time without time zone. Year = 2000 + byte. Seconds are not stored.

  • Version 24: the header time is the dive start. Use it directly.
  • Versions 20-23: the header time is the dive end. Start = end − duration. Variants:
    • reference implementation: for versions 21-23 the duration is the total dive time (21/22: offset 47, 23: offset 75), rounded down to whole minutes, to match the device display. For 20 it is the dive time field (min × 60 + s).
    • another implementation: duration = dive time field (min × 60 + s) for every version older than 24.

Example (version 23): end 2019-06-01 10:47, total time 2843 s → rounded 2820 s → start 10:00. The unrounded variant gives 09:59:37.

Model-specific variations

  • OSTC 4/5 diluent numbering. In CC dives the gas-change byte uses 6-10 for diluents 1-5. One implementation subtracts the number of fixed gases (5) only for OSTC 4/5 CC dives. Another subtracts 5 for any value in 6-10. The same second implementation treats manually set mixes on the OSTC 4/5 as open-circuit gases, even in CC mode.
  • OSTC 4/5 firmware below 1.0.8: deco/NDL samples are wrong and should be ignored.
  • hwOS Tech 3.03-3.08 and hwOS Sport 10.57-10.63: the ppO2 divisor is sometimes left non-zero while no ppO2 data is written. If a ppO2 field is due but fewer bytes than its size remain, treat its divisor as 0 for the rest of the dive.
  • hwOS Sport 10.40-10.50: tank pressure in 0.1 bar.
  • GNSS: the OSTC 4/5 may log a placeholder position (latitude 8.99, longitude 47.77 as stored). One implementation suppresses exactly that pair.
  • OSTC 4/5 dummy samples: if the stored profile no longer matches its header, the firmware synthesises a sample stream from header data instead of sending the original profile.

Confidence: likely (one or two open-source implementations. The firmware bug workarounds are not vendor-documented).

Open questions

  1. Depth unit. Samples are “mbar, not including salinity”. The header max depth is “centimetres” or “mbar”, “including salinity”. The vendor note “depth in metres = depth in mbar × g0 / 1000” is dimensionally odd. Implementations use raw / 100 (one applies × 9.80665 / 1000 to the average depth, following that note). Need dumps compared against the device display.
  2. Tank pressure unit (0.1 bar per vendor 2019, bar per OSTC 4/5 source and reference implementation).
  3. Alarm value 3: “deep stop missed” (Mk2 era, implementation) or “unused” (hwOS vendor doc).
  4. Event-byte assembly. One implementation shifts earlier bytes up (ev << 8 | next) and then tests 0x100 for bailout, which conflicts with the vendor bit assignment. The vendor assignment (byte k = bits 8k..) is specified here.
  5. Divisor entries: implementations either use the type byte (as specified here) or the table position. They agree while firmware writes types 0-6 in order.
  6. Version 20 and 22 layouts lack vendor documentation.

References

  • Heinrichs Weikamp, External Interface for Heinrichs Weikamp Dive-Computers with hwOS, 2019-04-10 (hwOS sources, doc/hwos_interface.pdf), https://code.heinrichsweikamp.com/public/hwos_code.
  • Heinrichs Weikamp, External Interface … hwOS and OSTC4/5, v16, 2025-07-13 (OSTC 4 sources, Documentations/hwos4_interface_v16.pdf), https://code.heinrichsweikamp.com/public/ostc4.
  • Heinrichs Weikamp OSTC Mk.2/2N/2C firmware source (GPL-3.0), divemode.asm, used as a factual reference for the version 21 header and sample writer.
  • Heinrichs Weikamp OSTC 4/5 firmware source (GPL-3.0), logbook.c, logbook.h, used as a factual reference.
  • libdivecomputer (LGPL-2.1), used as a factual reference; no code copied.
  • Subsurface’s libdivecomputer fork (LGPL-2.1), used as a factual reference for OSTC 4/5 variants; no code copied.