Skip to content

fix(switch_pro): bcdDevice is 0x0210; add max_power_ma / remote_wakeup identity constants - #801

Merged
finger563 merged 2 commits into
mainfrom
fix/switch-pro-bcd-device
Sep 18, 2026
Merged

finger563 merged 2 commits into
mainfrom
fix/switch-pro-bcd-device

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Summary

espp::SwitchPro::bcd_device said 0x0200, but a real Pro Controller reports bcdDevice 2.10 (0x0210). That is the value the ryhoh fork's hand-rolled descriptors used, the value usb_device's docs cite, and what finger563/esp-usb-ble-hid#27 now sets by hand. This fixes the constant so downstream emulators can use it as the single source of truth, and adds the two other descriptor details a Switch compares against alongside it:

  • bcd_device = 0x0210
  • max_power_ma = 500 (new)
  • remote_wakeup = true (new)

The switch_pro example feeds all three into espp::UsbDevice::Config (the fields from #796), and the README lists them.

Behaviour change for anyone reading SwitchPro::bcd_device: espp itself never used it before this PR, so only downstream code that copied the constant into its descriptors is affected, and it becomes correct.

Test plan

  • components/switch_pro/example builds (esp32s3, manager off)
  • Hardware: a Switch binds the example / the dongle with bcdDevice 2.10, MaxPower 500mA, remote wakeup

🤖 Generated with Claude Code

https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU

…p identity constants

A real Pro Controller reports device release 2.10 (not 2.00), 500 mA
bMaxPower and remote wakeup. Correct bcd_device and add the other two as
constants so emulators have one source of truth; the example feeds all three
into espp::UsbDevice::Config (bcd_device / max_power_ma / remote_wakeup, #796).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The public API and example descriptor changes are not fully reflected in the Sphinx and example README documentation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

Updates Switch Pro USB identity constants and configures the example with descriptor values matching a real Pro Controller.

Changes:

  • Corrects bcd_device to 0x0210.
  • Adds 500 mA and remote-wakeup constants.
  • Applies all descriptor values in the USB example and documents them in the component README.
File Description
components/​switch_pro/​include/​switch_pro.hpp Adds corrected descriptor identity constants.
components/​switch_pro/​example/​main/​switch_pro_example.cpp Applies descriptor constants to UsbDevice::Config.
components/​switch_pro/​README.md Documents the new constants.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread components/switch_pro/example/main/switch_pro_example.cpp
Comment thread components/switch_pro/include/switch_pro.hpp
…README and Sphinx page

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
@finger563
finger563 merged commit b37f27d into main Sep 18, 2026
166 checks passed
@finger563
finger563 deleted the fix/switch-pro-bcd-device branch September 18, 2026 23:55
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.

2 participants