Skip to content
52 changes: 49 additions & 3 deletions lib/openstrap_protocol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export 'src/records.dart'
// caller routes on the real set instead of keeping its own copy, which
// silently rots the day this one grows.
kKnownRecordVersions;
// gen5 historical-record decoders (v18/v20/v21/v26) — see gen5_records.dart
// gen5 historical-record decoders (v18/v20/v21/v22/v26) — see gen5_records.dart
// for why these replace the old, wrong parseGen5Record/{9,12,24} set.
export 'src/gen5_records.dart'
show
Expand All @@ -30,14 +30,20 @@ export 'src/gen5_records.dart'
Gen5OpticalBlock,
Gen5OpticalBuffer,
Gen5ImuBuffer,
Gen5PpgReconstruction,
Gen5PpgWaveform,
Gen5RecordDecoder,
Gen5ResearchOpticalWindow,
Gen5ResearchRecord,
Gen5SleepState,
Gen5V18Decoder,
Gen5V20Decoder,
Gen5V21Decoder,
Gen5V22Decoder,
Gen5V26Decoder,
kGen5HistoricalDecoders,
kGen5V22KnownTags,
kGen5V22InnerLen,
// The exact lengths are the live names; the *MinInnerLen* aliases below
// are deprecated and exported only so existing callers still resolve.
kGen5V18InnerLen,
Expand All @@ -51,7 +57,8 @@ export 'src/gen5_records.dart'
kGen5GyroScaleDps,
isGen5ImuBuffer,
parseGen5ImuBuffer,
parseGen5Historical;
parseGen5Historical,
reconstructSaturatedDeltaWindow;
export 'src/live.dart'
show
DecodedSample,
Expand Down Expand Up @@ -80,6 +87,7 @@ export 'src/commands.dart'
buildBatchAck,
initPackets,
WristSelection,
LabradorOperation,
cmdLinkValid,
cmdGetBattery,
cmdGetHello,
Expand Down Expand Up @@ -114,7 +122,44 @@ export 'src/commands.dart'
cmdSetConfigGen5,
cmdSetDeviceConfigValueGen5,
kGen5R22EnableFlags,
buildR22EnableSequence;
kGen5R22PreviouslyWrittenFlags,
buildR22EnableSequence,
// Previously built + unit-tested but unreachable from this entry point.
// Every opcode below appears in the official 75-opcode enum recovered
// from WHOOP's own Android client (reversing-whoop doc 04), so a caller
// is reaching for something the official app also sends.
//
// NOT exported, deliberately:
// • buildR22RestoreDefaultsSequence — writes raw '0' to every flag,
// which is not an official boolean value ('1'/'2' only; raw 0 =
// unset, doc 04) and not the observed pre-value, so it is not a
// correct restore. A correct restore is snapshot-based (GET each
// flag first, write back the recorded value with readback).
// • cmdGyroEnable (150) / cmdGyroStatus (152) / cmdSetEventPackets
// (48) — these opcode NUMBERS appear nowhere in doc 04's official
// enum. They came from third-party sources, which is the same
// provenance that produced the unverified 146/147 "Maverick clock"
// opcodes (doc 15 G5). They stay built and tested but unexported
// until a trace or a hardware capture backs them; shipping them as
// public API would present a guess as a capability.
cmdGetAlarmTime, // 67 — doc 04 R/P
cmdRawDataStart, // 81 — doc 04 R/P
cmdRawDataStop, // 82 — doc 04 R/P
cmdStopHaptics, // 122 — doc 04 R/P
// Filtered reading ("Labrador", R17) — doc 03 §"Filtered-reading (R17)
// lifecycle". The wrong-bodied cmdEcgControl (124 as a bool) and the
// opcode-126 cmdEcgSendRaw stay deprecated and unexported.
cmdLabradorDataGeneration, // 124 — doc 03 §R17 lifecycle
cmdLabradorRawSave, // 125 — doc 03 §R17 lifecycle
cmdLabradorFiltered, // 139 — doc 03 §R17 lifecycle
cmdGetCustomAdvertisingName, // 141 — doc 04 R/P
cmdSetCustomAdvertisingName, // 140 — doc 04 R/P, PERSISTENT write
cmdGetConfigKeyCount, // 115 — doc 04 R/P
cmdGetConfigKeyName, // 116 — doc 04 R/P
cmdGetFlagKeyCount, // 117 — doc 04 R/P
cmdGetFlagKeyName, // 118 — doc 04 R/P
cmdGetConfigValue, // 121 — doc 04 V/P (read-only)
cmdGetFlagValue; // 128 — doc 04 V/P (read-only)

// Control-plane parsers (HELLO / EVENT / METADATA / COMMAND_RESPONSE / dispatch).
export 'src/control.dart'
Expand All @@ -133,6 +178,7 @@ export 'src/control.dart'
parseRealtimeHrV2,
HelloInfo,
parseHello,
Gen5HelloInfo,
EventInfo,
parseEvent,
CmdResponse,
Expand Down
Loading
Loading