[libhid-discuss] usb_control_msg

Jorgen Lundman lundman at lundman.net
Fri Jun 22 12:00:19 UTC 2007



Or perhaps I do not need the Usage Path.. if the code I am porting has 
the calls like:

 ret=usb_control_msg(dev_h,USB_MSG_OUT,0x9,0x200,0x03,PACKET,length,TIME_OUT);
and
 ret=usb_interrupt_read(dev_h,0x00000081,data,URB_LENGTH,TIME_OUT);


I would need to replace these calls with a libhid equivalent. It would 
seem to me that the latter should be compatible with;

 ret=hid_interrupt_read(hid,0x00000081,data,URB_LENGTH,TIME_OUT);

But what do I do about usb_control_msg() ? I tried doing something 
naughty like:

 ret=usb_control_msg(hid->dev_handle,USB_MSG_OUT,0x9,0x200,0x03,PACKET,length,TIME_OUT);

Which claims to send 16 bytes (length is 16), but the 
hid_interrupt_read() always return -22. And I'm not sure the device is 
entirely happy afterwards (had to powercycle the device at least once)

Any advice?

Lund





More information about the libhid-discuss mailing list