Skip redundant SDP HID query when descriptor is already available#203
Open
diegoparrilla wants to merge 2 commits into
Open
Skip redundant SDP HID query when descriptor is already available#203diegoparrilla wants to merge 2 commits into
diegoparrilla wants to merge 2 commits into
Conversation
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
This PR fixes fake Bluetooth Xbox controllers that connect/authenticate/L2CAP successfully but then stall in SDP HID-descriptor query and get deleted by connection timeout.
What is the real change
If a HID descriptor is already present (e.g. injected by name-match for Xbox Wireless), Bluepad32 no longer starts an extra SDP HID-descriptor query.
Why we are doing this
Some cheap and dirty gamepads ($3-$5 in some marketplaces) pretend to be Xbox BT variants and expose VID/PID = 0x0000/0x0000 but can still be identified by name and assigned a synthetic HID descriptor.
Before this fix, Bluepad32 still attempted SDP HID query even though it already had a descriptor. On affected devices this query can stall, and the device is later dropped by connection timeout.
Why this is important
Makes fake Xbox BT pairing/ready flow deterministic on problematic firmwares/clones.
Validation
Tested with generic "Shanwan" models easy to find in Aliexpress (https://www.aliexpress.com/w/wholesale-shanwan.html ). They must be configured in Xbox 360 mode.