[libhid-discuss] unable to get input report

stdht.inbox at gmail.com stdht.inbox at gmail.com
Tue Jan 13 16:47:25 UTC 2009


Hello, Charles.

rawhid = linux/hiddev.h

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!!

 TRACE: hid_interrupt_read(): retrieving interrupt report from device 002/002[0] ...
WARNING: hid_interrupt_read(): timeout on interrupt read from device 002/002[0]
hid_interrupt_read failed with return code 23
// ALL OK IT'S JUST TIMEOUT device sends nothing...

  TRACE: hid_interrupt_read(): retrieving interrupt report from device 002/002[0] ...
 NOTICE: hid_interrupt_read(): successfully got interrupt report from device 002/002[0]
  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
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
WARNING: hid_interrupt_read(): failed to get interrupt read from device 002/002[0]: error submitting URB: No such device or address
  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
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] ...

--------------
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);
  } else {
      //printf( "interrupt\n" );
      for (i=0;i<64; i++) printf( "%u ", buf[i] );
      printf( "\n" );
  }
 }



> On Jan 13, 2009, at 3:44 AM, stdht.inbox at gmail.com wrote:

>> Hello
>>
>> My device is an usb barcode scanner. It works in 2 modes: simulates
>> usb keyboard or acts like usb2serial device (general hid). I use it  
>> in mode 2 as
>> general hid device.
>> I used raw hid under linux and was able to read interrupt reports and
>> used function ioctl(HIDIOCGUSAGES,...) to retrieve all the array of
>> usages (about 63 values)...

> If you send me some pointers to the "raw hid" API, I will take a look
> at it. I am in the process of rewriting the libhid backend to not be  
> tied to just raw libusb calls.

>>
>> Now I am using libhid. I receive interrupt reports without problems
>> but how to get array of usages????
>>
>> hid_get_input_report with path 0xff03c00, 0xff030d03, 0xff030022
>> or 0xff03c00, 0xff030d03, 0xff030050 with lengths (1,63,64) fails
>> with code 20.

> The error code is meant to be somewhat generic. (You can look up the  
> message name with hid_strerror(), by the way). What is usually more  
> interesting is the trace messages, as they tell you what operations  
> succeeded and failed.

-- 
С уважением,
 stdht                          mailto:stdht.inbox at gmail.com




More information about the libhid-discuss mailing list