[libhid-discuss] read from control pipe

Charles Lepple clepple at ghz.cc
Sat Jul 7 13:14:01 UTC 2007


On Jul 6, 2007, at 11:40 PM, Gabriel Maganis wrote:

>     How would I read from control pipe? I tried hid_interrupt_read
> with the ep parameter set to zero but I get a "No such file or
> directory" error but the endpoint 0 should always exist.

hid_interrupt_read() is for reading from an interrupt endpoint.  
Reading from the control pipe requires more parameters than just the  
pipe number and number of bytes to read.

If you need generic control pipe read functionality, you are better  
off using libusb directly: http://libusb.sourceforge.net/doc/ 
function.usbcontrolmsg.html

The direction of data transfer is encoded in the requesttype  
parameter. Check the USB specification (chapter 9, I think) for details.

-- 
Charles Lepple





More information about the libhid-discuss mailing list