[libhid-discuss] Still can't interrupt_read() properly

Charles Lepple clepple at ghz.cc
Wed Sep 10 00:41:04 UTC 2008


On Sep 9, 2008, at 7:20 PM, Peter Stuge wrote:

> Marian Aldenhoevel wrote:
>>> Try reading 64 bytes instead of 11 bytes.
>>
>> WARNING: hid_interrupt_read(): failed to get all of interrupt report
>> from device 001/006[0]; requested: 64 bytes, sent: 12 bytes.
>>
>> It then returns FAIL. That is understandable from the libhid code,
>> but I did get the 12 Bytes I was wanting (11 for the report,
>> there's the 0x42 reportID in front).
>
> So try 12 bytes.

Agreed. The docs don't clarify that, but this function call is just a  
thin wrapper around libusb. Without parsing the report descriptor, it  
can't know whether or not you have multiple report IDs, and  
therefore, whether to read an extra byte for the report ID.

Looks like I will have to relax the code in hid_interrupt_read() to  
allow short reads from the device.

Also, wMaxPacket is used by the kernel to split up the transfers, so  
from libusb or libhid, you do not need to be concerned

-- 
Charles Lepple





More information about the libhid-discuss mailing list