LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2014, 11:35 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
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?

Last edited by unSpawn; 02-04-2014 at 03:35 PM. Reason: //remove fake vBB tags before move.
 
Old 02-04-2014, 06:52 AM   #2
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
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
 
Old 02-04-2014, 08:13 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usb_control_msg send extra '0x00' bytes niekvanagt Programming 0 01-22-2013 04:44 PM
LibUSB on PIC18F4550 jeanCarloMachado Linux - Newbie 2 10-27-2011 01:56 AM
[SOLVED] usb_control_msg data inside module Jyke Linux - Kernel 1 09-20-2011 09:23 AM
want to use libusb in C, but confused ... cjh21017 Linux - Software 3 06-16-2011 05:32 PM
[SOLVED] ubuntu 9.10 - #include <libusb/libusb.h> stonehinge03 Linux - Newbie 5 04-20-2010 09:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration