Fix bonded BLE reconnects on ESP32#3005
Merged
Merged
Conversation
axhoff
marked this pull request as ready for review
July 20, 2026 14:51
hermes-gadget
added a commit
to gadgethd/MeshCore-MQTT
that referenced
this pull request
Jul 22, 2026
Upstream dev: 7ecb2cb..78240e9 (6 commits) 3885c67 fix: synchronize BLE receive queue 9fd6b41 fix: preserve bonded BLE reconnects 4d4d7c3 refactor: use FreeRTOS BLE receive queue 8b048ab Merge pull request meshcore-dev#3007 4157e43 Merge pull request meshcore-dev#3005 78240e9 optimised: value-init not needed Clean auto-merge (no conflicts). MQTT additions preserved.
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.
Summary
Root cause
On some bonded Android reconnects,
onAuthenticationComplete()ran before the BLE server updated its internal connected count. The authentication callback setdeviceConnected, butcheckRecvFrame()immediately observed a stale count of zero and cleared it permanently. The BLE link remained connected whilewriteFrame()refused to send responses.Scope
This keeps successful authentication as the event that enables frame writes and uses the existing disconnect callback as the event that disables them. Advertising restart timing, pairing requirements, frame queues, and protocol behavior are unchanged.
Validation
git diff --checkpio run -e Xiao_S3_WIO_companion_radio_bleFixes #2963