Skip to content

Bt con handle fixes#773

Merged
kilograham merged 4 commits into
raspberrypi:developfrom
peterharperuk:bt_con_handle_fixes
Jun 30, 2026
Merged

Bt con handle fixes#773
kilograham merged 4 commits into
raspberrypi:developfrom
peterharperuk:bt_con_handle_fixes

Conversation

@peterharperuk

Copy link
Copy Markdown
Contributor

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.

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.
@peterharperuk peterharperuk added this to the 2.3.0 milestone Jun 29, 2026
@peterharperuk peterharperuk requested a review from will-v-pi June 29, 2026 17:28
@peterharperuk

Copy link
Copy Markdown
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

will-v-pi
will-v-pi previously approved these changes Jun 30, 2026

@will-v-pi will-v-pi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - works for me

@will-v-pi will-v-pi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, accidentally pushed a different commit to this branch - have removed it

@kilograham kilograham merged commit 3085c7f into raspberrypi:develop Jun 30, 2026
6 checks passed
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.

3 participants