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

feat(hid): Add xbox battery input report #361

Merged
merged 2 commits into from
Jan 21, 2025
Merged

feat(hid): Add xbox battery input report #361

merged 2 commits into from
Jan 21, 2025

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Jan 21, 2025

Description

  • Add espp::XboxBatteryInputReport to hid-rp-gamepad.hpp
  • Update hid-rp/example to check compilation
  • Update hid_service/example to actually use and test the battery report

Motivation and Context

Some systems (such as iOS) show battery status as part of their gamepad display - and this status is different from the BatteryService. To be able to have some control over this, we need to implement this report type.

This is especially important when masquerading as an Xbox controller.

How has this been tested?

Building and running hid_service/example on QtPy ESP32s3 and checking on iPhone to make sure the GameControllers screen in Settings>General shows the updating battery level there.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

image
image
image
image

Note: battery service still shows correct info in the batteries widget:
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Add `espp::XboxBatteryInputReport` to `hid-rp-gamepad.hpp`
* Update `hid-rp/example` to check compilation
* Update `hid_service/example` to actually use and test the battery report
@finger563 finger563 self-assigned this Jan 21, 2025
Copy link

✅Static analysis result - no issues found! ✅

@finger563 finger563 merged commit 53711c6 into main Jan 21, 2025
69 checks passed
@finger563 finger563 deleted the feat/hid-battery branch January 21, 2025 20:28
SquaredPotato pushed a commit to smartknob-ha/espp that referenced this pull request Jan 27, 2025
* feat(hid): Add xbox battery input report
* Add `espp::XboxBatteryInputReport` to `hid-rp-gamepad.hpp`
* Update `hid-rp/example` to check compilation
* Update `hid_service/example` to actually use and test the battery report

* fix missing copy-paste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant