Add BLE HID Central example#566
Draft
ChocolateLoverRaj wants to merge 16 commits intoembassy-rs:mainfrom
Draft
Conversation
Use serde + postcard to no longer have to manually serialize / deserialize `BondInformation`.
4a40c14 to
d9202f1
Compare
d9202f1 to
dfcce23
Compare
More progress
dfcce23 to
c554c57
Compare
However this is not working properly on an Xbox Series X | S controller.
Contributor
Author
|
I'm having TrouBLE with this example on sudo hciconfig hci0 down && systemd-run --pty --uid=$(id -u) --gid=$(id -g) --same-dir --setenv RUST_LOG=trace --setenv PATH --setenv RUST_BACKTRACE=1 --property "AmbientCapabilities=CAP_NET_ADMIN" cargo run --bin ble_hid_central --features securityBut after doing conn.request_security().unwrap();I never get the and it continues having the I think there might be another bug with trouble-host that is causing this. On an Update: The But this example works fine on my laptop: |
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.
Closes #402.
Depends on #568
My idea is to make the example be generic for connecting any BLE HID peripheral(s).
When it's ready to merge I will remove my Nix / Zed specific files.
While I was testing this with two Xbox controllers, I found some interesting things.
The controller sends a update parameters request after encrypting. If you ignore the request, the controller will terminate the connection in 55-60s no matter what you do. If you accept the requested parameters, accept different parameters than requested, or reject the request, the controller will stay connected and work as expected.
However, the second controller always disconnected after 55-60s, even if I accepted the requested parameters, but with a 15ms connection interval instead of 7.5ms (because my esp32s3 seems to not be able to do 2 simultaneous 7.5ms connections.