LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   libusb: usb_control_msg. (http://www.linuxquestions.org/questions/programming-9/libusb-usb_control_msg-4175493571/)

stf92 02-03-2014 12:35 PM

libusb: usb_control_msg.
 
http://libusb.sourceforge.net/doc/fu...ontrolmsg.html This is all you find in the net abuot usb_control_msg. First, the number of parameters is two more than in the device request. Example:
Code:

int usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
int value, int index, char *bytes, int size, int timeout);

If you put timeout=0 then usb_control_msg will wait forever. Does it say so in the libusb documentation. Surely, but where?

gengisdave 02-04-2014 07:52 AM

function returns int number of bytes read or written, there are only two pointer, so *dev should be the device and *bytes the buffer; because you linked the prototype, i think sources haven't more infos

stf92 02-04-2014 09:13 AM

Very little. The parameters

requesttype
request
value
index

really correspond to

bmRequestType
bRequest
wValue
wIndex

in table 9-2 of the USB 1.1 specification but there is wLength also in the table. Besides, for the rest of the parameters, there is no documentation that I know of, certainly not in the libusb.sourceforge.net site. So for the designer it's a matter of guessing?


All times are GMT -5. The time now is 11:02 AM.