Skip to content

ESP32 BLE: retain sync replies when notification submission fails - #3832

Draft
gmaijoe wants to merge 1 commit into
meshcore-dev:devfrom
gmaijoe:fix/esp32-ble-notify-retry
Draft

gmaijoe wants to merge 1 commit into
meshcore-dev:devfrom
gmaijoe:fix/esp32-ble-notify-retry

Conversation

@gmaijoe

@gmaijoe gmaijoe commented Nov 13, 2026 •

Copy link
Copy Markdown

When Bluedroid rejects a notification (for example before notification subscription or during stack congestion), checkRecvFrame() still removes that response from the outgoing queue. Retain it until the synchronous SUCCESS_NOTIFY callback confirms submission, preserving the existing 60 ms pacing. Report a full outgoing queue as busy and defer queued commands until there is space for their reply.

All 98 host tests pass. Five new tests compile the actual ESP32 transport against BLE/FreeRTOS fakes; four fail on unpatched dev. They cover failed submission/retry order, subscription delay, stale success state, reply capacity, and disconnect cleanup. The Heltec V4 TFT BLE firmware build passes. A v1.18.0-based Heltec V4 TFT test build with this patch, #3831, and a local Bluetooth-name length guard completed contact/channel sync with MeshCore iOS 1.51.1. Recurring 0x08 link timeouts still occurred, so the short successful sync runs do not establish connection stability or isolate this patch’s effect.

Remaining validation: actual iPhone reconnect/sync behavior, sustained notification failures, and rapid reconnect timing. A persistent send failure currently keeps the head frame queued and can stall command processing or paced streams until sending succeeds or disconnect cleanup occurs; a bounded recovery policy needs review. SUCCESS_NOTIFY confirms submission to the stack, not receipt by the phone. The four-frame incoming burst limit is unchanged, and these tests do not exercise real controller timing or concurrency. This does not establish or fix the cause of recurring RF/encryption disconnects.

Related: #3633 proposes a broader BLE replacement; this patch is limited to the existing Bluedroid transport. Draft for human review and hardware validation, opened at the contributor's explicit request. Prepared with AI assistance; human line-by-line review is still pending.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant