[libhid-discuss] unable to get input report
Charles Lepple
clepple at ghz.cc
Tue Jan 13 22:44:18 UTC 2009
On Jan 13, 2009, at 11:47 AM, stdht.inbox at gmail.com wrote:
> Hello, Charles.
>
> rawhid = linux/hiddev.h
Oh, OK. When we first started writing libhid, the hiddev interface
did not handle the nested collections necessary to read information
from USB UPSes. It has changed since then, but some UPSes are still
blacklisted as a result.
> besides, I overworked..
> So my devices sends me scanned info in each interrupt report.
> I call hid_interrupt_read in loop (timeout=5000)
> I works ok! it works good at 2.6.x and 2.4.31 kernel...
> BUT!!! I tried my utility under linux 2.4.25 (my target
> embedded device). The result is bad. In the loop after the first
> hid_interrup_read timeouts and after that moment all subsequent calls
> to hid_interrup_read fail!!
Sounds like something specific to your platform. Have you checked to
see how long it waits before declaring a timeout?
> WARNING: hid_interrupt_read(): failed to get interrupt read from
> device 002/002[0]: error submitting URB: No such device or address
> hid_interrupt_read failed with return code 21
> TRACE: hid_interrupt_read(): retrieving interrupt report from
> device 002/002[0] ...
> host/usb-uhci.c : ENXIO 40010280, flags 0, urb c71e2d70, burb c54ee800
> USB error: error submitting URB: No such device or address
This error does not sound good - it's like the device disconnected
itself. Check to see if it still has the same device address in
'lsusb' (or /proc/bus/usb/devices)
> code:
> while(1) {
> ret = hid_interrupt_read(hid, 0x82, buf, 64, 5000);
> if (ret != HID_RET_SUCCESS) {
> printf( "hid_interrupt_read failed with return code %d\n",
> ret);
>
You should be able to do the following:
printf( "hid_interrupt_read failed with return code %d (%s)\n",
ret, hid_strerror(ret));
--
Charles Lepple
More information about the libhid-discuss
mailing list