Repository navigation
feat(app): read CV1 DIS serial number for per-unit hardware ID - #19722
Merged
Merged
Conversation
Read the DIS Serial Number String (0x2A25) in OmiDeviceConnection so
firmware that exposes the per-unit FICR ID populates BtDevice.serialNumber
and the existing hashed hardware_id analytics path. Firmware without the
characteristic returns an empty read and keeps hardware_id_kind
unavailable. Empty, placeholder ("unknown") and single-character-run
values are dropped so no shared fallback becomes a common hardware_id.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
OmiDeviceConnection also serves other Omi-protocol devices, so only a 16-hex-character unit ID is accepted as a serial; any shared or fallback value would otherwise merge units into one analytics hardware_id. Bound the 0x2A25 read with a 3s timeout so a missing native callback cannot stall connection setup, and pin that NativeBleTransport returns an empty read without a native call when older firmware lacks the characteristic. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What changed and why
OmiDeviceConnection.getDeviceInfo()now reads the BLE DIS Serial Number String (0x2A25). This is the app half of per-unit CV1 attribution. Firmware draft #19719 exposes each pendant's immutable nRF5340 FICR ID there.Once a serial is present, it flows through code that already exists.
BtDevice._getDeviceInfoFromOmialready copiesdeviceInfo['serialNumber'], andAnalyticsManager._deviceIdentityPropertiesalready emits a hashedhardware_idwithhardware_id_kind=manufacturer_serial. Today every CV1 event sayshardware_id_kind=unavailable: 529,660 of 529,660Device Connectedevents over 180 days. So we cannot tell which physical units, or which production lots, are failing.Backwards compatible with all existing firmware. Firmware without 0x2A25 is every released CV1 build up to 3.0.21. On
NativeBleTransport, a characteristic missing from the discovered GATT table returns an empty read without a GATT round-trip. That means no serial is set, andhardware_id_kindstaysunavailable, exactly as today. A read that throws is caught locally, so the other DIS fields are unaffected.parseSerialNumberaccepts only the CV1 unit-ID shape: exactly 16 hex characters, normalized to uppercase, and not a single repeated digit.OmiDeviceConnectionalso serves other Omi-protocol devices, so this strict check keeps any shared or fallback serial out of analytics. That includes the firmware'sunknownfallback and vendor strings; any of them would otherwise merge many units into onehardware_id. The read is bounded by a 3 s timeout, so a native read callback that never arrives cannot stall connection setup.Product invariants affected
none
How it was verified
cd app && bash test.sh test/unit/omi_connection_serial_number_test.dart test/utils/analytics/device_identity_analytics_test.dart test/providers/device_provider_test.dart test/unit/device_connection_find_pattern_test.dartplustest/services/devices/transports/native_ble_transport_test.dart→ all passed (138 + 36 across the two batches; Flutter 3.44.5, the CI version).flutter analyzeon the changed files: no new issues. The 6 existing infos are on untouched lines 541–802.Independent review by Codex (gpt-6-luna): no merge blocker. It confirmed that on iOS and Android a characteristic missing from old firmware returns immediately with no native read. Its three suggestions are applied in the last commit:
Not exercised on a physical pendant. Released firmware has no 0x2A25, so on real devices this is a no-op until feat(firmware): expose CV1 per-unit hardware ID as DIS serial number #19719 ships.
Tests
app/test/unit/omi_connection_serial_number_test.dartresolves aBtDevicethrough the realOmiDeviceConnection→BtDevice.getDeviceInfopath with a fake DIS transport. It covers:unknownfallback: rejectedparseSerialNumberedge casesnative_ble_transport_test.dartpins that reading an undiscovered characteristic returns[]without calling the nativereadCharacteristic. Old firmware depends on exactly that. The existingdevice_identity_analytics_test.dartalready covers the serial → hashedhardware_idpayload.Failure class (fixes)
Failure-Class: none
🤖 Generated with Claude Code