usb-gadget
usb-gadget copied to clipboard
Add a way for inserting custom descriptors?
Hi, I'm trying to work on a project that can emulate an xbox 360 controller, which has a slightly weird setup. Mainly, for each interface on the controller, there's some unknown (possibly hid, but no valid to hid spec) class descriptor. This unknown class descriptor has to be send after the interface descriptor, but before the endpoints.
I initially tried this in python, but wanted to change over to rust. The lib I used there has a 'class_descriptor_list' where it builds its descriptors before writing them.
ref to lib: https://github.com/vpelletier/python-functionfs/blob/c970265f6058982b68a028adeef5621b19a760b5/functionfs/init.py#L174 ref on xbox data: https://www.partsnotincluded.com/understanding-the-xbox-360-wired-controllers-usb-data/
Here's my wip as a gist: https://gist.github.com/Berghopper/44629d60708714d1dd66ebb3a6f30458
I can at least get the device recognized, but can't seem to progress past this point, any help with this would be great! (kind of new to usb gadgets/usb programming and rust in general)
edit1; I also only get a bind and enable event, it seems like the host never sends a request for setup?