[libhid-discuss] unable to get input report

Charles Lepple clepple at ghz.cc
Wed Jan 14 20:42:37 UTC 2009


On Jan 14, 2009, at 3:18 PM, stdht.inbox at gmail.com wrote:

> Hello, Charles.
>
> I've made some new experiments. I make hid_interrupt_read in a loop
> as before:
>
>  while(1) {
>   ret = hid_interrupt_read(hid, 0x82, buf, 64, 100);
>   usleep(1000*300);
>
^ you shouldn't need the usleep() here - all libhid calls are  
currently synchronous.

>   if (ret != HID_RET_SUCCESS) {
>        printf( "hid_interrupt_read failed with return code %d (%s) 
> \n", ret, hid_strerror(ret));
>   } else {
>
>   //printf( "interrupt\n" );
>     printf 
> ( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" );
>       for (i=0;i<20; i++) printf( "%u ", buf[i] );
>       printf( "\n" );
>     printf 
> ( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" );
>
>   }
>  }
>
>  It's surprising but device returns correct information!
>  What I receive:
>
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 14 49 50 51 52 53 54 55 56 57 48 49 50 56 13 0 0 0 0 0
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 9 49 50 51 52 53 54 55 48 13 0 0 0 0 0 0 0 0 0 0
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 13 49 50 51 52 53 54 55 56 57 48 49 50 13 0 0 0 0 0 0
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 13 49 50 51 52 53 54 55 56 57 48 49 50 13 0 0 0 0 0 0
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> hid_interrupt_read failed with return code 21 (libhid: interrupt  
> read failed)
>
>
> PS. may be my mistake is that I build my prog and libusb and libhid  
> under 2.4.31
> and try it under 2.4.25?? Or in other case there is something in
> usb-uhci...

The kernel version should not matter for building versus running,  
because a given combination of libhid and libusb versions will use  
the same kernel interfaces.

However, it could be a difference at the UHCI driver level. I would  
not be surprised if the timeouts were not working correctly in the  
platform-specific code.



More information about the libhid-discuss mailing list