Repository navigation
fix(ble): stop labelling a WHOOP 5/MG as WHOOP 4.0 - #2750
christophersarmiento wants to merge 2 commits into
Conversation
…cted The ryanbr#716 stamp replaced the seeded "WHOOP" model on the first scan result of any kind, using whichever family the scan happened to target. The auto-scan tries WHOOP 4.0 first, so an unsupported advertiser heard in that window (e.g. service 1150) labelled a 5/MG install "WHOOP 4.0" before the 5/MG leg ran, and forRegistryModel then treated the strap as a 4.0 (Devices label, skin-temp scale, 4.0-only copy). Move the stamp to the point where the scan has accepted a strap for the selected family and is about to connect, on both platforms. Refs ryanbr#716
… Apple Store DIS 0x2A24 and pass it to Whoop5Variant.from, as Android already does. A real MG reports serial prefix "MGB" and hardware revision "WS50_r03", which match neither heuristic, but its model number reads "MG". Without it the variant stayed unknown, so the attestation correction never relabelled a 5/MG that was registered as a 4.0. Refs ryanbr#520
|
Approved the workflow runs, so Android CI will now actually compile the Kotlin half for you. Traced both halves against the tree and the design holds up. Two things I checked that I want to record here because they are easy to doubt: the 2A24 read cannot leak onto a 4.0 (the DIS read is gated One hole, though, and it needs a different call site. The stamp no longer fires on the reconnect path
On those routes the seeded row keeps its // Packages/WhoopProtocol/Sources/WhoopProtocol/DeviceFamily.swift
static func forRegistryModel(_ model: String?) -> DeviceFamily {
switch model {
case "4.0", "WHOOP 4.0": return .whoop4
default: return .whoop5 // "WHOOP" lands here
}
}
Net effect: a WHOOP 4.0 whose first successful connect arrives by retrieve-and-connect rather than scan-and-connect keeps model Suggested changeCall To be precise about what that costs: at Smaller notes
|
What this PR does
A WHOOP 5.0 / MG install showed WHOOP 4.0 as its model on the Devices card. As a result,
DeviceFamily.forRegistryModeltreated the strap as a 4.0 everywhere: the label, the skin-temp raw→°C scale, and copy that applies only to a 4.0 ("no steps over BLE on a 4.0"). Two bugs combined to cause this.1. #716 stamp fired on any scan result (Apple + Android)
my-whooprow's placeholder model"WHOOP"was replaced on the first discovery callback of any kind, beforewhoopGattScanDecisionran, using whichever family the scan was targeting."WHOOP 4.0"before the 5/MG leg ran.2. DIS model number was not used to resolve the variant on Apple
MGBand hardware revisionWS50_r03, which match neitherWhoop5Variantheuristic. Its DIS 0x2A24 Model Number readsMG.Whoop5Variant.fromalready acceptsmodelNumber:(Found a repository that might help with Whoop 5 sensor decoding #520), and Android already passes it.BLEManageronly logged 2A24, so the variant stayed.unknownandreconcileModelFromAttestationnever upgraded a mislabelled row.BLEManagernow stores 2A24 asdisModelNumber, clears it on teardown, and passes it to bothWhoop5Variant.fromcall sites, matchingWhoopBleClient.isMG), as Android already does.Type of change
How it was tested
WHOOP 4.0and loggedvariant=—.NOOPiOS, iOS 27), the Devices card reads WHOOP 5.0 / MG.Strandscheme:xcodebuild … buildsucceeded.NOOPiOS: built and installed on device.Tools/doc_comment_lint.py: OK.android.yml. Not exercised on an Android device.Checklist
android/(relying on CI, see above)StrandDesigntokens (no UI changes)docs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/keystoresRelated issues
Refs #716
Refs #520