![]() ![]() It tells us that the controller uses USB 2.0 ( bcdUSB), and that the max packet size for endpoint 0 (the device control endpoint) is 8 bytes ( bMaxPacketSize0). The device descriptor ( bDescriptorType of 0x01) is 18 bytes in length ( bLength). Here’s the wired controller’s full device descriptor as reported by Wireshark: This is the big picture – it tells the host what USB standard to use when talking to the device, the identification for who made it and what product it is, and the number of configuration descriptors that follow. The top level descriptor is the device descriptor. These are useful resources, although neither of them did a thorough breakdown of what the descriptor means. There have also been a few people who have posted online information about how the Xbox 360 controller’s USB works, such as Zach Littell, who created an XInput implementation for the Teensy. There is also some information available in the (now defunct) Free60 wiki via the Internet Archive. There are a number of websites that helped me make sense of these descriptors, including USB Made Simple, USB in a NutShell, and of course the public standards themselves – available at USB.org. Some of this information may be a little hard to follow if you’re not familiar with USB communication. Thankfully this method has told me everything I need to know to emulate the control data endpoints. It would have been better to use an inline analyzer with an actual Xbox 360 console, but unfortunately I have neither of those things on hand. This is just what was easy and worked for me. ![]() There are plenty of other tools you can use to read these descriptors, either from the host (PC) or with an inline USB analyzer. ![]() I’ve verified those breakdowns to the best of my ability using publicly available information about the USB standard. Wireshark provides both the raw data from the USB packet and a breakdown of the values using its built-in analyzers. After plugging in the controller Windows will request the device and configuration descriptors, and the controller will respond in kind. To sniff the USB data I’m using Wireshark version 2.6.4 with the USBPcap plugin. I’m using a genuine Microsoft Xbox 360 wired controller, connected to my desktop which is running Windows 10. I want to understand how the information in these descriptors translates into features of the device’s behavior. By copying the Xbox controller’s descriptors onto my own device, I can convince the computer that my device is also an Xbox controller and will behave like one, and therefore use the Xbox controller’s driver to easily interface with games.īut rather than just copying and pasting the descriptor from one place to another, I want to try and understand exactly what’s going on behind the scenes. These descriptors are a hierarchy of standardized reports that describe features of the device including who makes it, what version of USB it supports, how it’s powered, and more. The first step in this process is to fetch and then break down the device’s “USB descriptors”. One of my recent projects has been trying to modify some microcontrollers to function as XInput devices, emulating an Xbox controller. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |