Repository navigation
Send the LE Enhanced Connection Complete event when the host unmasks it - #1025
Merged
Merged
Conversation
The controller always sent LE Connection Complete, even when the host had unmasked LE Enhanced Connection Complete, so a host such as Linux, which expects the enhanced event when LL Privacy is supported, waited until its connection timeout. Send the v1 enhanced event when bit 9 of the LE event mask is set, and the legacy event otherwise. Fixes google#841
zxzxwu
approved these changes
Nov 5, 2026
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.
Fixes #841.
The controller always sent
HCI_LE_Connection_Complete_Event, both when it creates a connection as central and when it accepts one as peripheral. It ignored the LE event mask the host sets. Per Vol 4, Part E 7.7.65.1 and 7.7.65.10, only the enhanced event should be sent when the host has unmasked it. The controller advertises LL Privacy by default, so the Linux kernel unmasks and waits for the enhanced event, and connecting through VHCI hits the 20 second timeout described in the issue.Both places now go through
send_le_connection_complete_event:HCI_LE_Enhanced_Connection_Complete_Event, with all-zero resolvable private addresses, whichDevicealready treats as "none".HCI_LE_Connection_Complete_Event, unchanged.Notes on the behaviour:
le_event_mask = 0rather than the spec default0x1F, so gating it would leave hosts that never set the mask with no event at all.test_le_connection_complete_event_follows_le_event_maskintests/device_test.pysets the LE event mask on two devices, connects them, and checks the event type, role and peer address each controller sends. With the enhanced bit set it fails onmainand passes with this change. Bumble's ownHostunmasks the enhanced event, so the other device tests now exchange it end to end, and they still pass.