wearfit protocol (howear hk8 ultra / hk8 pro max) - #50
Conversation
frame envelope + battery request/reply for the wearfit / wearfit2 / wearfit pro app family (0xab header, no crc, no encryption). pairs and banks bytes only, decodes nothing but battery.
Reviewer's GuideIntroduces an experimental WearFit protocol module for Howear HK8-family bands, exposing a no-CRC/no-encryption frame envelope, generic frame parsing/building, battery request/reply support, and comprehensive captured-byte validation tests. Sequence diagram for WearFit battery request and replysequenceDiagram
participant App
participant Band
App->>App: wearFitCmdGetBattery()
App->>Band: Write 0xAB 0x00 0x04 0xFF 0x91 0x80 0x01
Band-->>App: Notify battery frame
App->>App: parseWearFitFrame(value)
App->>App: parseWearFitBattery(f)
App-->>App: WearFitBattery(chargeState, percent)
Flow diagram for WearFit frame parsingflowchart LR
Input[Notification bytes] --> Parse[parseWearFitFrame]
Parse -->|valid header marker length| Frame[WearFitFrame]
Parse -->|invalid frame| Reject[null]
Frame --> Battery[parseWearFitBattery]
Battery -->|opcode 0x91 and valid status| Report[WearFitBattery]
Battery -->|other opcode or invalid values| Ignore[null]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reachedNext included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
adds the wearfit frame envelope for howear-branded bands (hk8 ultra, hk8 pro max), paired through the wearfit / wearfit 2.0 / wearfit pro app family.
no crc, no encryption. only builds/parses the frame + the battery request/reply — no other opcode is decoded.
Summary by Sourcery
Add experimental WearFit framing and battery support for Howear bands.
New Features:
Enhancements:
Tests: