Bt con handle fixes#773
Merged
kilograham merged 4 commits intoJun 30, 2026
Merged
Conversation
We're setting the connection handle via HCI_EVENT_LE_META / HCI_SUBEVENT_LE_CONNECTION_COMPLETE, however we don't get this event when ENABLE_LE_ENHANCED_CONNECTION_COMPLETE_EVENT is set in btstack_config. Instead get the handle via HCI_EVENT_META_GAP / GAP_SUBEVENT_LE_CONNECTION_COMPLETE - which is what btstack examples use.
It should be con_handle like the server and most other examples.
Contributor
Author
|
The secure example has some redundant code for this event but actually behaves properly - I've pushed a change to remove the bad code in here #767 |
89a4d7d to
6696819
Compare
will-v-pi
approved these changes
Jun 30, 2026
will-v-pi
left a comment
Contributor
There was a problem hiding this comment.
Sorry, accidentally pushed a different commit to this branch - have removed it
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.
A change was made to add ENABLE_LE_ENHANCED_CONNECTION_COMPLETE_EVENT to the btstack config as it makes pairing more reliable. But this has shown up some faulty example code.
We no longer get the HCI_EVENT_LE_META / HCI_SUBEVENT_LE_CONNECTION_COMPLETE event.
Instead we should get the handle from HCI_EVENT_META_GAP which handles the difference for us.
This is what the rest of the btstack examples do.