forked from Blendman974/faceclaw
Implement the 2.2.9 security-auth exchange on every stock-facing BLE connection
Firmware 2.2.9 requires the sid-0x80 DEVICE_SETTINGS/AUTHENTICATION(4) exchange shortly after each GATT connection: it gates query responses on completing it over an encrypted link, and closes unauthenticated links after ~30 s. On a phone with no existing bond (no inherited stock-app pairing) the exchange is also what triggers SMP pairing. This is why the onboarding firmware check failed with "no response to the device-info query" on a fresh device: the probe connected, the prelude was acked, but the settings query was never answered and no pairing ever happened. (See ../notes/ble-connections-2.2.9.md, validated by g2flash on hardware.) - BleProtocol: buildAuthenticationRequest / isAuthenticationSuccess (strict: command 4, matching magic, empty result message), SID_SECURITY_AUTH. - Device-info probe: authenticates before the prelude with a 30 s window (the user may need to accept an OS pairing prompt; the check page says so). Soft on non-response since the probe also runs against the custom firmware — but a query timeout after unconfirmed auth now names the pairing problem. - Flash-prompt communicator: authenticates each arm before the prelude (mandatory — it only ever talks to stock firmware). - Firmware flasher: control-channel notifications are now mandatory, each lens authenticates before OTA BEGIN, and the OTA-time heartbeat is gone — official captures show no control traffic during a transfer, heartbeats demonstrably do not satisfy the 2.2.9 deadline, and a concurrent control writer interleaves with the marker/data transactions. The OTA envelope counter now resets after bring-up, mirroring the stock sequence. - Main communicator: authenticates both arms after connecting, before the prelude, with a short soft wait (logs and continues on timeout so firmware that never answers cannot stall reconnects). Hardware test pending: fresh-device onboarding against stock 2.2.9 (check, prompt, flash), and a regression pass on custom-firmware connect + probe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV
This commit is contained in:
1 parent
17182532f4
commit
1bde70aa45
9 files changed
+281
-74
No files matched your search
@@ -8,7 +8,7 @@ export type DeviceInfo = {
|
||||
capabilities: string;
|
||||
};
|
||||
|
||||
export type DeviceInfoState = "connecting" | "querying";
|
||||
export type DeviceInfoState = "connecting" | "authenticating" | "querying";
|
||||
|
||||
/**
|
||||
* TS wrapper around the native FaceclawDeviceInfoProbe — a one-shot,
|
||||
|
||||
@@ -163,6 +163,9 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
private reportProbeState(state: DeviceInfoState): void {
|
||||
if (state === "connecting") {
|
||||
this.status = "Connecting to your glasses...";
|
||||
} else if (state === "authenticating") {
|
||||
// First-time connections pair here; the OS may show a Bluetooth dialog.
|
||||
this.status = "Authenticating with your glasses... If Android asks to pair, tap Pair.";
|
||||
} else if (state === "querying") {
|
||||
this.status = "Reading the firmware version...";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user