[libhid-discuss] hid_interrupt_write() error

Charles Lepple clepple at ghz.cc
Thu Sep 28 03:30:59 UTC 2006


On Sep 27, 2006, at 6:12 PM, Mark S. Townsley wrote:

> Thanks Charles.  It works that both interrupt_write() and  
> interrupt_read() returns "SUCCESS".
> However, the char * returned by interrupt_read() is emptied.
>
> I am writing a series of bytes and supposedly, the device will  
> response with a 2-byte size message.  When I print out the message,  
> that is nothing.

Not sure what to say here - it is highly firmware dependent.

> And BTW, in lsusb, the MaxPacketSize is 8 bytes.  Does that mean I  
> cannot write more than 8 bytes (let say 12 bytes) at a time?

In theory, yes. The Linux USB subsystem will break things up into  
properly-sized packets.

>   And if I need to write more than 8 bytes (let say 12 bytes), do I  
> issue interrupt_write() 2 times (8 bytes + 4 bytes) in a row?

I don't really know if that behavior is defined by the spec -  
usually, you would not have to write more than MaxPacketSize to a HID  
device, since the data would most likely be broken up into different  
reports.

-- 
Charles Lepple
clepple at ghz.cc





More information about the libhid-discuss mailing list