Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HID Gamepad Client & Central HID Gamepad example #730

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

OstlerDev
Copy link
Contributor

Hello! I have been working on a personal project recently and came across some missing functionality inside of the library. There was no way to connect as a Central role to an HID Gamepad peripheral. I went ahead and implemented it myself closely mirroring the Keyboard support.

This work is related to and extends upon the following old issues and pull requests.

The testing process I took is as follows:

  1. Upload the (newly updated) example at examples/Central/central_hid/central_hid.ino to an Adafruit Feather NRF52840 Express board
  2. Upload the example at examples/Peripheral/blehid_gamepad/blehid_gamepad.ino to an Adafruit Feather NRF52840 Express board
  3. View each's Serial Console to verify:
  • They both fully pair to each other
  • The Central feather is able to receive gamepad reports from the Periph feather
  • Both polling and callback functionality works from the Central role

I am fairly confident it should be ready to be merged in, however I would greatly appreciate feedback on what to change.

Changelog

Added

  • Example for connecting to BLE Gamepads from a Central role
  • Support for HID Gamepad Clients in BLEClientHidAdafruit

Changed

  • Allow for up to 8 BLE Characteristics inside of BLEDiscovery (This is likely something that will need discussion and feedback on it)
  • Add Debug logging to log UUID of all BLE Characteristics for a service inside of BLEDiscovery

@willwade
Copy link

+1 for merging this! It looks great

@someburner
Copy link

bump- I see no reason to not merge this, works fine!

@OstlerDev
Copy link
Contributor Author

OstlerDev commented Jun 9, 2023

It would be great to see this merged in! 😸

@hathach
Copy link
Member

hathach commented Jun 9, 2023

sorry for late response, I am wrapping other works and will review this as soon as I could. Thank you for your patient.

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

Perfect ! Thank you very much for the PR, this is spot-on, very clean modification. I have nothing to add. I have tested with central/peripearl gamepad and they are able to connect and send gamepad reprot. Sorry for the huge delay, this somehow falls off my radar.

Note: the hid_gamepad_report_t is specific to the peripheral implementation of gamepad report. For usig with other gamepad, an parser is required to know which report key is for which button. Thank you again.

@hathach hathach merged commit 54242a6 into adafruit:master Jun 15, 2023
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.

4 participants