LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 02-05-2007, 12:48 PM   #16
halfwit
LQ Newbie
 
Registered: Mar 2006
Location: Texas
Distribution: Fedora Core x
Posts: 14

Original Poster
Rep: Reputation: 0

What is it doing?

All messages have this list of parameters (take note of the buffer var) :
device handle, 0x21, 0x9, 0x200, 0, <buffer>, 8, 1000

The buffer var is the command portion. All buffers have 8 bytes.

A stop message (sent at least after any command to signal a stop) has bytes of all 0's (character '\0' or a integer value of 0)

A movement/fire message is the same except for the first byte which is either a 1, 2, 4, 8, or 16. After all movement/fire commands you will want to wait for some timeout before sending the stop command. For movements I wait for 50000000 nanoseconds and for a fire I wait 5 seconds.

I'm still looking at cleaning this up into a kernel module at sometime so that I don't have to worry about permissions and knowing what position it starts in. As with everything, time is the enemy that prevents things from getting done.

If anyone can figure out how to get the device to give back information would help me in that.

Jim
 
Old 02-09-2007, 02:40 PM   #17
shatteredllama
LQ Newbie
 
Registered: Jan 2007
Location: Its hard to tell
Distribution: Gentoo & Slackware
Posts: 10

Rep: Reputation: 0
I'm still trying to read from the device as well. I cannot find anything in the libusb documentation nor the usb spec which is helpful. There is a hint in the libusb examples section telling us to look in some camera drivers that they link to. However, school has started so I am rather busy and dont have time to put enough effort into digging through their code to get anything useful out of it. Also, I doubt that a camera which needs a sustained transfer would work in the same way as this little guy, which presumably just uses control messages. However, there may be is something useful in the camera config and discovery mechansims.

maniaq: if you want to know the error string associated with the number code, just do a strerror(errnum) (unix error codes are positive, but for some reason the libusb guy flips the sign, so you need to flip it back)

If I set up an SVN or CVS server, would either of you use it? Communicating like this is kinda inefficient, we need to share code.

okay...my professor is giving me dirty looks for not paying attention, gotta go.
 
Old 01-21-2008, 03:23 AM   #18
rockballad
LQ Newbie
 
Registered: Nov 2007
Distribution: Fedora 8/Ubuntu 7.10
Posts: 23

Rep: Reputation: 15
Hi,

How can I know the index parameter in
Code:
int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout);
if I'm using SnoopyPro. Or anything else can help me out?

Thanks.

Last edited by rockballad; 01-21-2008 at 04:09 AM.
 
Old 01-22-2008, 10:36 AM   #19
halfwit
LQ Newbie
 
Registered: Mar 2006
Location: Texas
Distribution: Fedora Core x
Posts: 14

Original Poster
Rep: Reputation: 0
For the device we are using, the index value is always 0. If memory serves, I believe the index had something to do with a predefined command for a given usb device class. Since the device we were using didn't fall into any of the usb device classes, it wasn't any use for us.

As I am not really an expert on it, and it was about a year since there was any movement on this on my part, I can't really say for sure. I seem to remember that index was the only bit of information that my sniffer didn't tell me.

You might try reading the usb specification at www.usb.org. I wouldn't bother with libusb's documentation. It is a single step on the far side of useless.
 
Old 01-23-2008, 01:59 AM   #20
rockballad
LQ Newbie
 
Registered: Nov 2007
Distribution: Fedora 8/Ubuntu 7.10
Posts: 23

Rep: Reputation: 15
Quote:
Originally Posted by halfwit View Post
For the device we are using, the index value is always 0. If memory serves, I believe the index had something to do with a predefined command for a given usb device class. Since the device we were using didn't fall into any of the usb device classes, it wasn't any use for us.

As I am not really an expert on it, and it was about a year since there was any movement on this on my part, I can't really say for sure. I seem to remember that index was the only bit of information that my sniffer didn't tell me.

You might try reading the usb specification at www.usb.org. I wouldn't bother with libusb's documentation. It is a single step on the far side of useless.
That's true. The index for my case is 0 too. I use sniffusb to generate the code. Hic

Thanks,
 
  


Reply

Tags
driver, libusb, usb


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
libusb compile error gabyx Programming 10 03-24-2010 05:38 AM
Help getting libusb 0.1.12 installed... 003 Suse/Novell 7 07-15-2006 03:45 PM
libusb compiler error, Help!!! Librason Programming 1 03-10-2006 10:46 PM
help me --- interrupt_read() in libusb shiva_teknic Programming 0 09-27-2005 09:17 AM
libUSB install Dutch3 Linux - Newbie 1 04-30-2002 08:15 AM


All times are GMT -5. The time now is 09:39 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration