[libhid-discuss] help

Peter Stuge peter at stuge.se
Thu Jun 17 23:50:03 UTC 2010


Hi Roberto,

Roberto Diaz wrote:
> I'm developing an application that would communicate with an HID device
> either through interrupt or control transfers.

Will this in fact be a HID class device, or was HID chosen mostly
because it is so easy to use on Windows?

On all other platforms, HID is quite the opposite; it is much more
complicated than vendor-specific, similarly to how HID is less
complicated than vendor-specific on Windows.

Unless it is in fact a human interface device, then I strong
recommend exposing a vendor-specific USB interface instead of HID.

Using WinUSB and/or libusb-1.0 it is actually possible to get a
unified API for most popular platforms. (Windows support is being
integrated into libusb-1.0.)


>   TRACE: hid_interrupt_write(): writing interrupt report to device
> 001/005[0] ...
> 
> WARNING: hid_interrupt_write(): failed to perform interrupt write to device
> 001/005[0]: error submitting URB: Device or resource busy
> 
> hid_set_output_report failed with return code 21

Could the device firmware be the cause of this problem? It would be
most helpful to have usbmon output for this interrupt write.


> P.S. The device I'm using supports both HID interrupt and control
> transfers and I have confirm that this specific device works
> whitout problems trought a similar windows application.

On numerous occasions it has been seen that Windows requires less
strict compliance from device firmware than pretty much all other
operating systems, which has lead many developers to believe that
the firmware in their devices is OK because it works with Windows.

Unless the goal is to let the device tie into the operating system's
native HID layer then I would strongly recommend to consider instead
using a vendor-specific interface. It removes the HID layer from the
equation, and allows full freedom for using all USB features in the
firmware and driver, which can be very beneficial for applications
as well as firmware, and which also makes any debugging much easier.


//Peter



More information about the libhid-discuss mailing list