2

I am working on an Android project that will connect to an Xbox 360 controller. I want to be able to capture user feedback via the controller's input reports. I am using Virtual Box and AndroidVM for testing and have used the following for reference to the USB protocol (especially as it pertains to the Xbox controller):

To name a few of the links I am using for information. I have also referenced HID protocol information to examine the packet descriptions.

I have successfully been able to detect and enumerate the controller via the VM AND have been successful in obtaining input reports using the Android SDK API (e.g. USBManager, USBInterface, USBDevice etc.), but only by explicitly making a request for the report using a control transfer request.

I would like to be able to pull these input reports via interrupts on the appropriate endpoint. I have attempted to read packets from the first endpoint on the first interface (getInterface[0] and getEndpoint[0]) and I do receive data, but am having difficulty parsing the data in the byte buffer (I have the buffer set as little endian). In particular, how do I know the delimiters for each packet? I know each packet starts with a Sync field and that this Sync is 8bits and the last two bits indicate where the PID starts, but I am not sure exactly what that means. What are Ks and Js as many documents describe for the Sync and how are these represented as bits? Also, all packets are supposed to have an EOP, does this need to be parsed or is this handled by hardware?

Pradeep Pati
  • 5,779
  • 3
  • 29
  • 43
user2507288
  • 121
  • 2

0 Answers0