On Tue, 20 Sep 2005, Jim Jensen wrote:

> Greetings,
> 
> I'm a retired software developer, somewhat new to Linux--especially
> internals.  I'm trying to write an application in c++ to operate the new
> Meade Instruments Deep Sky Imager (DSI), which is a simple CCD camera
> designed for amateur astronomy.
> 
> Of course, Meade supplies an application that runs on Windows but I hope
> to create a Linux version and post it on SourceForge, as I have done
> with some other software I've written
> (http://www.sourceforge.net/projects/kuery)
> 
> I'm primarily an applications guy (running SuSe 9.3/KDE/KDevelop), and
> I've hoped there might be a way I can perform raw USB i/o using open,
> read, write, close from c++ using a device /dev/usb/ttyUSBxxx.
> Specifically, I'm hoping I can avoid having to learn much about the
> details of the usb API and use some high-level stuff instead.
> 
> I notice several puzzling things: /proc/bus/usb/devices refers to buses,
> ports and addresses, atrs, but /dev/usb/ttyUSBxx has major and minor
> device numbers.  Is there a correspondence of some kind?  If the camera
> is on bus02 port02 is there a way I can determine
> which /dev/usb/ttyUSBxx to open and perform reads on?

There is a correspondence.  You ought to be able to see it by looking 
through the system log for the time when the USB serial port device was 
detected.

While there's no direct way to go from bus & port to ttyUSBxx, you can go
the other direction.  Look in the /sys/class/tty/ttyUSBxx directory and
see what you find.

> Can you point me to some (non low-level API) documentation on this
> subject?  Better yet, to some sample application code?

You should be able to program /dev/usb/ttyUSBxx the same as any other 
serial port.  Note that this means open, read, write, and close aren't 
enough -- you also need to do things like set the baud rate and so on.

Alan Stern



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to