Programming the USB Port

This is a discussion on Programming the USB Port within the C++ Programming forums, part of the General Programming Boards category; I am interested in learning how to read and write to the USB port on my computer. Specifically, I want ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    9

    Programming the USB Port

    I am interested in learning how to read and write to the USB port on my computer. Specifically, I want to read in some position info from a GPS. I can already do this using a serial port, however my application will required that I use the USB port. If anyone could offer me some sample code or direct me to a "useful site" I would certainly appreciate it.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    http://www.lvr.com/parport.htm
    Also has some USB stuff as well.

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Every USB device & driver are different...

    As far as I know there is no standard way to communicate with a GPS device.

    In general, the USB device manufacturer writes both the device firmware and the driver. Only these two "programs" know what to do with the data that travels over the bus. (i.e. You can't use an HP printer with an Epson printer... In fact, the programmers at HP don't know how to write a driver for an Epson printer.)

    If the USB device is a common device (like a printer) then Microsoft specifies a standardized way for Windows to communicate with the driver. You can write a word processing program without worrying about the driver or hardware... In fact, the word processing program doesn't care if you use a parallel, USB, or Network printer. The driver (written by the hardware manufacturer) translates between the Windows standard requirements and the proprietary hardware requirements.

    If it's a specialty USB device, then there are two choices. The hardware manufacturer can write the application, or he can provide a SDK (Software Development Kit). That's what we do where I work... But, we dont' make GPS devices. If you can get an SDK and/or library from the manufacturer, then you're cool! If the manufacturer doesn't provide any information on how to communicate with the device, you are probably out of luck.
    Last edited by DougDbug; 01-23-2006 at 01:25 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port to USB controller and outb()
    By coletek in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2009, 06:57 AM
  2. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  3. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  4. USB port "monitor"
    By Victor in forum Windows Programming
    Replies: 1
    Last Post: 04-13-2005, 05:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21