How to communicate via USB "port"

Tim Roberts timr at probo.com
Thu Apr 19 02:21:57 EDT 2007


"robinp.la at gmail.com" <robinp.la at gmail.com> wrote:
>
>Can someone explain how I would read the data from the USB "port"? I
>don't know if it matters, but I am trying to read the data from a GPS
>plugged in to the USB port.

USB is a "protocol" bus.  It isn't like a serial port, where you can just
start reading bits.  Each device has one or more "interfaces", and each
interface has one or more "pipe" for transmitting data.  You have to know
which "pipe" to talk to, what kind of pipe it is, and how to force the
device to send before you can talk to it.

On the other hand, as someone else pointed out, many types of USB devices
fall into standard device classes, and the operating system supplies
drivers for those classes.  If your GPS device is in the communication
class, you might be able to pretend it is a serial device.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list