Note that there are some explanatory texts on larger screens.

plurals
  1. POlibusb interrupt transfer
    primarykey
    data
    text
    <p>I need to reverse engineer a driver for custom made HID USB device (some buttons and leds on an control panel). The driver is only available on Windows and we need a *nix implementation.</p> <p>The device apparently is a HID device although not of a particular class. It provides two interfaces each with a single interrupt endpoint.</p> <p>My setup currently involves a VirtualBox running Windows on a Ubuntu host to capture the USB traffic via Wireshark. The protocol is rather simple and I already gained a rather good understanding. </p> <p>I am using libusb-1.0 in a simple C++ console program for prototyping. I already managed to toggle LEDs by issuing a SET_REPORT control transfer but struggle in receiving button presses via interrupt in transfers.</p> <p>In fact the following call blocks forever:</p> <pre><code>unsigned char bytes[8] = { 0 }; int len = 0; int ret = libusb_interrupt_transfer(handle, 0x81, bytes, 8, &amp;len, 0); </code></pre> <p>When inspecting the resulting URB in Wireshark it looks exactly like the equivalent captured at the Windows session. Still I never get a reply from the device.</p> <p>I fell I am missing some setting. Note that the device is properly opened and both interfaces provided by the device have been sucessfully claimed. Input reports by means of control transfers are coming trough, even in my linux application.</p> <p>Thanks for any pointer! Arne</p> <p>Addendum I: I am wondering how am I supposed to specify which report id I want to receive when using <code>libusb_interrupt_transfer()</code>?</p> <p>Addendum II: When comparing the requests made by the windows driver to the one generated by the above code in Wireshark I don't see any difference (same values in URB). But still, only when issued by the Windows driver the interrupt transfer returns. </p> <p>When inspecting the Windows driver communication in Wireshark I dont see any control transfers other than various <code>GET_DESCRIPTOR(...)</code>. Most important: no <code>SET_INTERFACE</code> or <code>SET_CONFIGURATION</code> Thus I suspect the problem is related to the library or how I use it and is <em>not</em> related to the device.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload