Skip to content

Add RWfit ring family support - #130

Open
saksham2001 wants to merge 2 commits into
mainfrom
claude/chinese-ring-app-integration-b38e34
Open

Add RWfit ring family support#130
saksham2001 wants to merge 2 commits into
mainfrom
claude/chinese-ring-app-integration-b38e34

Conversation

@saksham2001

Copy link
Copy Markdown
Owner

Summary

Adds support for the RWfit (com.rw.revivalfit) ring family — often rebranded (the known field unit was sold as a "Colmi") — reconstructed from the vendor app's source, shared with the vendor's cooperation.

  • One family, two wire protocols: all RWfit rings share the A00A/B002/B003 GATT but speak either the legacy 0x7E framing (XOR checksum, serials, mandatory two-sided ACK handshake) or the JieLi 0xAB framing (CRC-16/ARC, {CMD,Key,KeyFlag} triples, headerless continuations). The framing is only knowable from which sibling services (AE00/Telink/PixArt) service discovery turns up, so a new WearableDriver.servicesDiscovered hook (default no-op) lets the driver pick its codec before the first byte is written.
  • Full metric set on both protocols: steps, HR, SpO₂, sleep (incl. REM and the JieLi stage-transition-stream reconstruction), BP, HRV, stress, temperature, blood sugar, battery, bind/unbind, time sync, profile/goal/units, and JieLi realtime measurements. Per-unit sensors are capability-gated off the ring's own feature report (legacy 0x03 bitmap / JieLi bind TLV); the manual/realtime measurement set is granted only on JieLi links — the vendor app has no legacy measure command at all.
  • Timezone handling deliberately diverges from the vendor (whose legacy math is off by an hour half the year in DST zones): both framings' local-epoch stamps are converted through a latched-offset RWfitClock, the JringClock contract.
  • Remote validation loop: a new Privacy & Data toggle ("Capture Bluetooth diagnostics", off by default, clearable) lets release/TestFlight builds persist raw packets and include them in the diagnostics export — the only way to validate a family nobody has in hand.
  • Recognition is by service/manufacturer-data signals only (A00A; company IDs 0x05D6/0x06D6), never by name; the catalog card's name patterns stay empty until the first real capture.
  • Docs: docs/hardware/rwfit.md records every layout with vendor file:line evidence and the open [unconfirmed] items (steps slot duration, distance units, realtime +10 offset, bind type byte).

Test plan

  • Full xcodebuild test suite passes.
  • 5 new suites with fixtures computed from the vendor parsers: both codecs (incl. CRC-16/ARC reference vector, multi-packet/continuation reassembly, ACK quirks), decoder (timezone/DST tests, sleep expansion for both formats, scaling), driver (framing selection, ACK-before-decode, command-gate discipline), history pager.
  • PairingMatchingTests cross-claim matrix extended: RWfit claims only its own signals, claims no names, is registered last, and no existing family's advertisement is stolen.
  • On-hardware validation via the tester's diagnostics export (raw-capture toggle → pair → sync → export).

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.

1 participant