Home > Archive > Tcl > May 2004 > talking to a USB device on Linux
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
talking to a USB device on Linux
|
|
| mitch 2004-05-17, 10:32 am |
| I want to try to write a users space program to talk to a USB-2.0 device.
( to start out with , everything will be done under the latest Linux 2.4 ~or~ 2.6 Kernel.)
Has anyone tried this using pure tcl ? ( seems do-able since it is little more than File
I/O )
Assuming the /proc/bus/usb filesysytem will be present, how should I approach this ?
Eventually I will be communicating with a currently "under development" USB device.
But for now finding and monitoring a mouse or some other common USB device would be a
good "training lesson".
Can anyone kickstart me ?
....thanks in advance,
Mitch
| |
| Mac A. Cody 2004-05-18, 6:32 pm |
| mitch wrote:
> I want to try to write a users space program to talk to a USB-2.0 device.
> ( to start out with , everything will be done under the latest Linux 2.4
> ~or~ 2.6 Kernel.)
> Has anyone tried this using pure tcl ? ( seems do-able since it is
> little more than File I/O )
>
> Assuming the /proc/bus/usb filesysytem will be present, how should I
> approach this ?
>
> Eventually I will be communicating with a currently "under development"
> USB device.
>
> But for now finding and monitoring a mouse or some other common USB
> device would be a good "training lesson".
>
> Can anyone kickstart me ?
>
> ...thanks in advance,
> Mitch
>
Mitch,
For starters take a look a the libusb project at
http://libusb.sourceforge.net . Perhaps you could first make a Tcl
extension which wraps around the libusb library. This is not in
pure Tcl, of course, but a start. I'm not sure that you can do
it in pure Tcl because of the ioctl command that needs to be used
in libusb. I don't think that there is scripting-level access to
the ioctl function from Tcl. If someone knows better, feel free
to chime in.
I've thought about writing a wrapper around libusb, since I'm
currently working on a webcam driver using libusb. My time is
quite limited for working on the webcam, though, so I've been
doing all the work in C.
Mac Cody
To reply, reverse the cast and the com.
|
|
|
|
|