Skip to content

Jring: offer ring-recorded workouts; keep spot HRV; mask unused 0x13 - #74

Merged
gabrielbr merged 3 commits into
mainfrom
ccr-67ccb970-dqwwqd
Nov 11, 2026
Merged

gabrielbr merged 3 commits into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

@gabrielbr gabrielbr commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Why

The owner asked to import the workouts the ring records in its own sport mode, and then everything else the ring can provide. To find out what that was, every reply opcode the vendor SDK parses was checked against PulseLoop's decoder.

What

  • Workouts recorded on the ring (0x25 <day>, the vendor's getMultipleSportData).
    • Frame: a timestamp and six one-minute slots. A slot's sport type has its low nibble in the slot and its high nibble packed into bytes 17–19.
    • Value: 12 bits per slot. It is steps for walk, run and climb, and calories ÷ 10 for every other sport. A5 FF ends the day.
    • Reconstructed parser: jadx marks the vendor parser as decompiled incorrectly, so the layout was rebuilt from its arithmetic. JringRingWorkoutTest round-trips it.
    • Sync: JringHistorySync asks for it last each day.
    • Grouping: RingWorkoutLog keeps the minutes for 10 days and groups them into sessions (same sport, pauses of 3 minutes or less, at least 3 minutes long).
    • On the Activity tab: each session is offered like another device's workout ("Recorded by your ring", one tap to add), under a ring- id that the export sends. A ring session that overlaps another device's workout gives way to it.
    • No duplicates: PulseLoop never starts the ring's sport mode, so these can't duplicate its own recordings.
  • HRV from the spot measurement. 0x24 byte 8 is now kept as HRV, in 10–200 ms. The vendor stores it as type 19.
  • 0x13 masked. The vendor parses it and then discards it, so its fields have no reliable meaning. It is now named unused_health_frame and masked in diagnostics. Before this, it was exported whole as unknown.
  • Nothing else to import. The other opcodes the vendor parses are settings acknowledgements, ECG (not on this ring), or watch-only features.

Docs: docs/jring-56ff-plan.md and AGENTS.md.

Not hardware-checked yet: the 0x25 layout needs a capture from a ring that recorded a workout. No UI changed (the existing suggestion card is reused), so there's no new audit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w

The vendor's last request of each day is getMultipleSportData(day) =
25 <day>. Each frame holds six one-minute slots. A slot's sport type is
split into a low nibble in the slot and a high nibble packed into bytes
17–19, with a 12-bit value: steps for walk/run/climb, calories ÷ 10 for
every other sport. A5 FF ends the day. jadx marks the parser as
decompiled incorrectly, so the layout is rebuilt from its arithmetic and
round-tripped in a test.

JringHistorySync asks for it last, after the other offline logs.
RingWorkoutLog keeps the minutes for 10 days and groups them into
sessions: same sport, pauses up to 3 minutes, 3 or more minutes long.
The Activity tab offers them like another device's workouts ("Recorded
by your ring", one tap to add) under a ring- id that the export sends.
A ring session overlapping another device's workout gives way to it.
The minutes are in the diagnostics redactor's masked set.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
Checked every reply opcode the vendor SDK parses against our decoder.
- 0x24 byte 8 is HRV. The vendor stores it as type 19 when it is above 0.
  We now keep it as HRV, within 10–200 ms.
- 0x13 arrives about every sync. The SDK parses it as
  onGetCurSportData(1, …), but the vendor app's handler drops everything
  except type 0, so its fields mean nothing reliable. It is now named
  UnusedHealthFrame (kind unused_health_frame) and masked in diagnostics.
  Before this it was exported whole as unknown.

Everything else the vendor parses is a settings acknowledgement, ECG
(not on this ring) or a watch-only feature. Recorded in the plan doc.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr gabrielbr changed the title Jring: offer workouts recorded on the ring Jring: offer ring-recorded workouts; keep spot HRV; mask unused 0x13 Nov 11, 2026
@gabrielbr
gabrielbr merged commit ed81fe1 into main Nov 11, 2026
1 check passed
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.

2 participants