From 3e440830a3135478da19c021c93ae64b1d25a0a3 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sun, 23 Aug 2026 17:32:15 -0700 Subject: [PATCH] Flash prompt: retry the page-create once (2.2.9 post-prelude drop window) The device-info frame trace settled the remaining firmware-check mystery: the right lens is the correct settings endpoint, but on stock 2.2.9 a request written immediately after the prelude ack is sometimes silently dropped while the lens emits its own sid-0x80 notifications (flag 0x01, cmd 4, device-chosen magic, result {f1:1}, ~2 s apart). The probe's retry answers within ~100 ms every time, so the check now passes; the left-lens fallback never fired. The flash-prompt page-create goes out at exactly the same post-prelude moment, so give it the same single retry. Finding documented in ../notes/ble-connections-2.2.9.md. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV --- .../app/FaceclawFlashPromptCommunicator.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFlashPromptCommunicator.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFlashPromptCommunicator.java index c96b5148..fab525f7 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFlashPromptCommunicator.java +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFlashPromptCommunicator.java @@ -226,10 +226,20 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener { throw new IllegalStateException("session prelude not acked: " + address); } // 3. Create the prompt page (warning text + No/Yes list) on sid=0xe0 Cmd=0. - int magic = allocMagic(); - byte[] page = BleProtocol.buildCreatePromptPage( - magic, TEXT_NAME, TEXT_CONTAINER_ID, warningText, LIST_NAME, LIST_CONTAINER_ID, ITEMS); - if (writeAndAwaitAck(address, BleProtocol.SID_EVENHUB, BleProtocol.FLAG_REQUEST, magic, page, CREATE_ACK_TIMEOUT_MS) == null) { + // Two attempts: on 2.2.9 the first request sent right after the + // prelude can be dropped while the lens emits its own sid-0x80 + // notifications (observed with the device-info settings read). + byte[] pageAck = null; + for (int attempt = 0; attempt < 2 && pageAck == null && !cancelled; attempt++) { + int magic = allocMagic(); + byte[] page = BleProtocol.buildCreatePromptPage( + magic, TEXT_NAME, TEXT_CONTAINER_ID, warningText, LIST_NAME, LIST_CONTAINER_ID, ITEMS); + pageAck = writeAndAwaitAck(address, BleProtocol.SID_EVENHUB, BleProtocol.FLAG_REQUEST, magic, page, CREATE_ACK_TIMEOUT_MS); + if (pageAck == null) { + emitLog("prompt page attempt " + (attempt + 1) + " unacked: " + address); + } + } + if (pageAck == null) { throw new IllegalStateException("prompt page not acked: " + address); } emitLog("prompt page shown on " + address);