From 4b4ab1b02c7579ab12d6ccc5a5e3d4f0da9b9c4d Mon Sep 17 00:00:00 2001 From: MasterControl Date: Mon, 16 Nov 2026 06:51:41 +0000 Subject: [PATCH] fix(ble): drop CONNECTION_PRIORITY_HIGH for G2 arms HIGH negotiates a ~5s supervision timeout that kills the link on any >5s BLE gap and can strand an arm in a half-open state where it stops advertising (recoverable only by a 5-tap reset). Mirrors the ring fix in connectRing, which removed HIGH for the same reason. BALANCED keeps a longer supervision timeout; the firmware's own fast-profile request still negotiates speed for transfers. --- .../app/g2protocol/session/GlassesSessionCore.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/native/kotlin/shared/src/commonMain/kotlin/com/faceclaw/app/g2protocol/session/GlassesSessionCore.kt b/native/kotlin/shared/src/commonMain/kotlin/com/faceclaw/app/g2protocol/session/GlassesSessionCore.kt index 1de741b7..c5726288 100644 --- a/native/kotlin/shared/src/commonMain/kotlin/com/faceclaw/app/g2protocol/session/GlassesSessionCore.kt +++ b/native/kotlin/shared/src/commonMain/kotlin/com/faceclaw/app/g2protocol/session/GlassesSessionCore.kt @@ -2464,11 +2464,13 @@ class GlassesSessionCore( throw ArmUnreachableException(if (address.equals(leftAddress, ignoreCase = true)) "left" else "right", address) } } - // requestConnectionPriority has no callback in this Android compile target, so there is - // no reliable completion point to keep it in the global GATT operation pipeline. But it's - // important enough for performance that we call it anyways. - link.requestHighPriority(address) - + // Deliberately NOT requesting CONNECTION_PRIORITY_HIGH for the arms (mirrors the + // ring in connectRing). HIGH negotiates a ~5 s supervision timeout (interval=12 / + // timeout=500, 5000 ms) which makes the link die on any >5 s BLE gap and can strand + // an arm in a half-open "connected" state where it stops advertising and is only + // recoverable by a 5-tap reset. BALANCED's longer supervision timeout survives those + // gaps. The firmware's own fast-profile request (ble_link.c) still negotiates speed + // when a transfer needs it. link.requestMtu(address, ConnectionOptions.DESIRED_MTU, ConnectionOptions.CONNECT_TIMEOUT_MS) if (!link.discoverServices(address, ConnectionOptions.SERVICES_TIMEOUT_MS)) {