Repository navigation
Jring: offline BP/stress/sugar/HRV, SpO₂ and temperature history; calibration on the detail screens - #73
Merged
Conversation
…on on the detail screens From the JRing 2.0.8 decompile: the app passes the ring's BP and sugar through unchanged. The ring computes them from the profile (0x02) and a cuff reference (0x33, write-only, default 120/80). The ring also logs those estimates every 15 minutes (0x55, gated on 0x20 bit 83, which the vendor builds LSB first). JringHistorySync now asks for it as the third step per day, after heart rate, and ends a past day on its 23:45 slot. RingDecoder.decodeSensorHistory stores BP only when both halves are set and every other value only when non-zero, as the vendor does. The BP and glucose detail screens gain a Calibration card: what the estimate is calibrated against, and a button to Settings → Calibration. TodayViewModel no longer adds the cuff reference to BP readings; it is a reference the ring uses, not an offset. Findings recorded in docs/jring-56ff-plan.md and AGENTS.md. Tests for the decoder and the new pager step. Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
After each day's heart rate, the vendor asks for each offline log the ring
advertises, in this order: temperature (bit 10, 0x39), SpO₂ (bit 81, 0x40),
then the 0x55 sensor log. JringHistorySync now runs the same chain, ends a
leg on the 23:45 slot or when it settles, and skips a day the ring answers
with B9 ("getdayabyday failed").
- 0x40: 15 one-minute SpO₂ readings per frame, kept in the 70–100 band.
- 0x39: three 5-minute slots; only the surface (skin) value is stored.
The 0x20 reply now also reports TEMPERATURE when bit 10 is set, granted
per unit through JringCoordinator.bitmapGatedCapabilities. The owner's
ring (003A002AV138) sets bits 10, 81, 83 and 84. Tests use that ring's
real reply.
Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
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.
Why
The owner asked whether the JRing app fakes BP and sugar. Reading the decompiled app (JRing 2.0.8, kept local and gitignored) answered it:
0x02) and a cuff reference (0x33). The reference is write-only and defaults to 120/80.The ring also keeps offline logs that we never read. The owner asked to:
What
Offline history, per day after heart rate, in the vendor's order. Each log is asked for only when the ring's capability reply (
0x20) sets the matching bit, as the vendor does.39 <day>40 <day>55 <day>B9reply means the ring has no log for that day.utils.m.b).003A002AV138) sets bits 10, 81, 83 and 84. Its real0x20reply is in a test.Temperature granted per unit. A ring that sets bit 10 is granted TEMPERATURE at runtime (
JringCoordinator.bitmapGatedCapabilities). The family baseline still leaves it out, because SR08-class rings don't set that bit.Calibration on the BP and glucose detail screens. A card shows the stored cuff or meter reference and a button to Settings → Calibration. The ring has no read-back: its
0x33reply is only an acknowledgement.Bug fix.
TodayViewModeladded the cuff reference to each BP reading, as if it were an offset. Nothing displayed those fields, so no wrong number was ever shown.Docs.
docs/jring-56ff-plan.md:Tests:
JringSensorHistoryTestand newJringHistorySyncTestcases.Audit:
audits/2026-11-11-v2.16.2-calibration-sensor-history.mdDesign canvas: not updated. The canvas tools weren't connected when this was written. The
VitalDetailboard still needs the Calibration card.🤖 Generated with Claude Code
https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w