I need to reverse engineer the driver for a specially configured HID USB device (some buttons and LEDs on the control panel). The driver is only available on Windows, and we need a * nix implementation.
The device is apparently a HID device, although not for a specific class. It provides two interfaces, each with one endpoint breakpoint.
My installation currently includes a Windows-based VirtualBox on the Ubuntu host to capture USB traffic through Wireshark. The protocol is pretty simple, and I already got a pretty good understanding.
I use libusb-1.0 in a simple C ++ console program for prototyping. I have already managed to switch the LEDs by releasing the SET_REPORT control transfer, but struggle with pressing the button by pressing the interrupt in the transfers.
In fact, the following call blocks are forever:
unsigned char bytes[8] = { 0 }; int len = 0; int ret = libusb_interrupt_transfer(handle, 0x81, bytes, 8, &len, 0);
When checking the received URB in Wireshark, it looks exactly the same as the equivalent received in a Windows session. However, I never get a response from a device.
I fell, I am missing some settings. Please note that the device is correctly opened, and both interfaces provided by the device have been successfully announced. Input reports via pilot transfers come in, even in my Linux application.
Thanks for any pointer! Arne
Addendum I: I wonder how I should indicate which report identifier I want when using libusb_interrupt_transfer() ?
Appendix II: When comparing requests made by the Windows driver with the one created by the above code in Wireshark, I donβt see the difference (the same values ββin URB). But still, only when issued by the Windows driver does the interrupt transmission return.
When checking the connection of the Windows driver in Wireshark, I do not see any control transfers, except for various GET_DESCRIPTOR(...) . Most important: no SET_INTERFACE or SET_CONFIGURATION Thus, I suspect that the problem is with the library or how I use it and is not related to the device.