[libhid-discuss] Connecting to a HID device (VOIP 321) with libhid

Charles Lepple clepple at ghz.cc
Fri Dec 28 14:23:45 UTC 2007


On Dec 28, 2007, at 8:54 AM, Cristian S. Rocha wrote:

> """
> WARNING: hid_prepare_report_descriptor(): HID report descriptor for  
> USB
> device 002/006[0] is too short; expected: 1793 bytes; got: 45 bytes.
> """
>
> I feel this warning it's not important, but it cant let me open the
> device. Then I commented this check in the
> "hid_prepare_report_descriptor" function in the libhid source. It
> continue running but I had more errors.

Actually, it is pretty bad - there are two ways to get the HID report  
descriptor, and the way that libhid is using has exposed a bug in the  
device firmware.

The HID code in the Network UPS Tools package retrieves the HID  
descriptor both ways, and chooses the most likely candidate. I  
haven't had a chance to merge that code in yet.

> Before open the device my code call "hid_set_idle(hid, 0, 0x0)" as you
> describe in one thread of the list. But it return the following error:
>
> """
> WARNING: hid_set_idle(): failed to Set_Idle for USB device
> 002/006[0]:error sending control message: Connection timed out.
> """

This error is not good - it usually means that the firmware has  
crashed on the device, or is not handling things properly. However,  
if you have the USB Snoopy logs, you can check to see if the Windows  
code actually sends a Set_Idle request. It may not be necessary.

> Other question. I have the USB Snoopy file with complete connection
> protocol of the device. Exists any program to browse these information
> in linux?

I have found that several people have written tools that read the  
ASCII log files which you can export from USB Snoopy. Since there are  
several different variants of USB Snoopy floating around the 'net, I  
doubt there would be a program that reads the binary log files.

You may be interested in http://iki.fi/lindi/usb/usbsnoop2libusb.pl

-- 
Charles Lepple





More information about the libhid-discuss mailing list