USBhost_t36 support for varieties of XBox One gamepads

I am using the wonderful joystick feature of the USBhost library to provide control for an underwater robot using an XBox One gamepad. However, there is a problem. As often as not when a random XBox One gamepad is connected to the Teensy, the code is unable to identify it because the USB device ID doesn't match any entries in the list built into joystick.cpp. I have dealt with this by adding new device IDs to my copy of the library file, but I'm getting to the point where others are using the code, and it's rather tedious to do this.
Is there any way to build a more comprehensive ID code list into the library on Github?
 
Thanks for the reply. I'll collect all the XBox One gamepad IDs I can get my hands on.

I do have another question regarding the vendor/device ID:
How can I print these values from my sketch when a USB device is plugged in and enumerated, if it's not in the list already?
I ask because Windows remaps any XBox One gamepad into 045e:02ff in Device Manager, so I can't find the hardware ID using that.
I have uncommented #define USBHOST_PRINT_DEBUG to see the enumeration process in Serial Monitor, which gives me the info I need. However, that's not feasible for production code.
 
I have found a workaround. The Windows device I was looking at was the HID device, which is apparently a virtual USB device that's created by the USB driver in Windows.
The actual USB hardware ID code for the gamepad can be read by looking in
Device Manager > Universal Serial Bus controllers > USB Root Hub > Details > Children.
It's the last line if it was plugged in most recently.
I'd love for the Teensy USB host code to know how to do that device mapping, but I'm sure it took a few coders at Microsoft a while to write that code.
 
Back
Top