Skip to content

JRing heart-rate interval: the vendor's 15/30/45/60 - #94

Merged
gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd
Nov 19, 2026
Merged

gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

Copy link
Copy Markdown
Owner

The owner asked for a 15-minute option for the JRing's background heart rate.

Why

The owner's export showed the ring reading only every 30 minutes in the daytime. That interval was ours: 0x19 byte 6 was hardcoded to 30, sent on connect and after every stream.

Change

  • Where the choices come from: the vendor app (HeartrateTestActivity) offers 15, 30, 45 and 60 minutes, defaults to 30, and only shows its picker when the 0x20 reply sets bit 18 (FUNCTION_HEART_SHOW_AUTO_INTERVAL).
  • Which rings get it: JringBandCapabilities.hasAutoHeartRateInterval reads bit 18 and grants MEASUREMENT_INTERVAL per unit, the same way bit 10 grants TEMPERATURE. The owner's ring sets it.
  • Engine: JringSyncEngine stores the saved settings. 0x19 carries the saved interval, snapped onto the vendor's stops by JringHeartRateInterval.snap; a ring with no saved setting still gets 30. It is sent on connect, on Save, and when a spot or workout stream ends.
  • Measurement frequency screen, for a JRing: the heart-rate switch, a four-stop slider (15/30/45/60), and one note. The SpO₂, stress, HRV and temperature switches are hidden because nothing on the wire carries them.
  • Comparison with iOS upstream: iOS offers 5–60 minutes and tightens the interval during workouts. Neither is ported here (see docs/jring-56ff-plan.md).

Checks

  • New JringHeartRateIntervalTest covers snapping, the default, sending on connect and on Save, restoring after a stream, the off switch, and bit 18 on the owner's real reply.
  • JringSensorHistoryTest now expects both features granted by the owner's reply.
  • JRing, decoder, type-scale and button tests pass locally.
  • Audit: audits/2026-11-19-jring-hr-interval.md, covering the four skills, with impeccable run on renders at 1.0× and 1.3×.
  • pt-BR string added.
  • Design canvas: the Measurement frequency board still needs a JRing variant. That is owed, as on the earlier PRs.

Generated by Claude Code

The app sent a fixed 30-minute 0x19 on every connect and after every stream.
A ring whose 0x20 reply sets bit 18 (the vendor's condition for its picker)
now gets Measurement frequency with 15, 30, 45 or 60 minutes, and the saved
value goes out on connect, on Save and after a stream ends.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr
gabrielbr merged commit c817abd into main Nov 19, 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