Files
Sub 2e243fa093 pad2c 1.0.0: Ultimate 2C dongle in XInput mode (fixes #2), signed notifications (#3)
* pad2c 0.2.2: Ultimate 2C dongle in XInput mode (fixes #2)

With the controller in XInput mode the receiver enumerates as 2dc8:310a
with an XInput interface (ff/5d/01), a boot keyboard and a vendor HID.
0.2.1 read the first HID interrupt IN endpoint: the keyboard.

- usbdesc.c picks the interface from the configuration descriptor:
  XInput first, from any vendor, then on an 8BitDo the first HID that
  is not a boot keyboard or mouse.
- mapxinput.c maps the Xbox 360 input report to the DualSense layout.
- usbpad.c opens the XInput OUT endpoint and sets the player LED, as a
  PC does.
- tests/test_usb.c: the 310a descriptor from the issue, the 301c one,
  and the XInput map.
- tools/setup-macos.sh: build on macOS with Homebrew LLVM.

Tested on a PS5 Slim, 13.60: DInput (301c), switch to XInput (310a),
and back, all buttons, sticks and triggers.

* Notifications: "pad2c by Sub", then the controller, its mode and what happened

Every notification now reads

    pad2c by Sub
    8BitDo Ultimate 2C Wireless Controller (XInput) connected

The name is read from the device's product string descriptor with a
standard GET_DESCRIPTOR (USB_GET_DEVICEINFO fails on the 8BitDo dongle).
The receiver names itself the same in DInput (301c) and XInput (310a),
so the mode is shown beside it.

- usbdesc_string(): UTF-16LE string descriptor to ASCII, with tests.
- usbpad_mode(): "DInput" or "XInput".
- All messages in English.

Tested on the PS5: connect, disconnect, XInput and back.

* Version 1.0.0; CODEOWNERS: every change needs the owner's review

The XInput fix and the signed notifications are released as 1.0.0.
.github/CODEOWNERS names @sub0x00001 for every file, so the main
ruleset's code owner review asks for the owner on every pull request.
2026-10-22 15:38:30 -03:00
..