Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. Generic USB access

Generic USB access

Scheduled Pinned Locked Moved Hardware & Devices
c++csharpquestion
11 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    legit
    wrote on last edited by
    #1

    Hey all, I have several projects that I want to complete that involve USB devices. I was wondering if there is any generic way to grab the output and input to any USB device. I'm not looking for anything too clean, just something that works for the moment, as I will spend time adjusting the method to my various projects. At any rate, is there a generic way to access the output and input of any USB device in windows? (or even just grab the output?) thanks, - legit legit-tech.net I'm moving this post from the MFC/C++ forum (if an admin wants to remove that other post to prevent duplicate posts that'd be great!)

    D 1 Reply Last reply
    0
    • L legit

      Hey all, I have several projects that I want to complete that involve USB devices. I was wondering if there is any generic way to grab the output and input to any USB device. I'm not looking for anything too clean, just something that works for the moment, as I will spend time adjusting the method to my various projects. At any rate, is there a generic way to access the output and input of any USB device in windows? (or even just grab the output?) thanks, - legit legit-tech.net I'm moving this post from the MFC/C++ forum (if an admin wants to remove that other post to prevent duplicate posts that'd be great!)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      legit wrote:

      I was wondering if there is any generic way to grab the output and input to any USB device.

      No, there isn't. USB is not a port, like serial or parallel. It's a BUS, just like the PCI bus you stuff cards into inside the machine. Communicating with any device on the bus requires you to go through the interface supplied by the drivers for that device.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      L S 2 Replies Last reply
      0
      • D Dave Kreskowiak

        legit wrote:

        I was wondering if there is any generic way to grab the output and input to any USB device.

        No, there isn't. USB is not a port, like serial or parallel. It's a BUS, just like the PCI bus you stuff cards into inside the machine. Communicating with any device on the bus requires you to go through the interface supplied by the drivers for that device.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        L Offline
        L Offline
        legit
        wrote on last edited by
        #3

        Oh, Ok, thanks for explaining that, makes since now. Always wondered why USB was so different. - thanks

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          legit wrote:

          I was wondering if there is any generic way to grab the output and input to any USB device.

          No, there isn't. USB is not a port, like serial or parallel. It's a BUS, just like the PCI bus you stuff cards into inside the machine. Communicating with any device on the bus requires you to go through the interface supplied by the drivers for that device.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          I have a couple of USB boxes which support performing digital and analogue I/O. They didn't come with drivers (and as I run FILEMON when I install stuff, I can be reasonably sure of that!). However, there is an API library supplied to communicate with the hardware. Presumably this uses a standard MS-supplied driver to provide user-mode access to allow tx/rx of requests/replies sent to the devices?

          Steve S Developer for hire

          D L 2 Replies Last reply
          0
          • S Steve S

            I have a couple of USB boxes which support performing digital and analogue I/O. They didn't come with drivers (and as I run FILEMON when I install stuff, I can be reasonably sure of that!). However, there is an API library supplied to communicate with the hardware. Presumably this uses a standard MS-supplied driver to provide user-mode access to allow tx/rx of requests/replies sent to the devices?

            Steve S Developer for hire

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You need the documentation on that SDK, otherwise, it's useless. That SDK is your only method of communication with the devices.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            S 1 Reply Last reply
            0
            • S Steve S

              I have a couple of USB boxes which support performing digital and analogue I/O. They didn't come with drivers (and as I run FILEMON when I install stuff, I can be reasonably sure of that!). However, there is an API library supplied to communicate with the hardware. Presumably this uses a standard MS-supplied driver to provide user-mode access to allow tx/rx of requests/replies sent to the devices?

              Steve S Developer for hire

              L Offline
              L Offline
              legit
              wrote on last edited by
              #6

              Is this a windows supplied API? or did it come with the devices? Also, is there documentation for it? thanks

              S 1 Reply Last reply
              0
              • D Dave Kreskowiak

                You need the documentation on that SDK, otherwise, it's useless. That SDK is your only method of communication with the devices.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                S Offline
                S Offline
                Steve S
                wrote on last edited by
                #7

                I appreciate that (and I have, and use, the documentation), but my point is that it must be using some user-level mechanism which does not depend on a manufacturer-specific driver, instead using some generic way of communication. My next obvious step would be to run Depends on the supplied DLL, and see what it loads that I don't recognise.

                Steve S Developer for hire

                D 1 Reply Last reply
                0
                • L legit

                  Is this a windows supplied API? or did it come with the devices? Also, is there documentation for it? thanks

                  S Offline
                  S Offline
                  Steve S
                  wrote on last edited by
                  #8

                  It came with the device, and comes with documentation on it, but not how the underlying DLL itself works.

                  Steve S Developer for hire

                  1 Reply Last reply
                  0
                  • S Steve S

                    I appreciate that (and I have, and use, the documentation), but my point is that it must be using some user-level mechanism which does not depend on a manufacturer-specific driver, instead using some generic way of communication. My next obvious step would be to run Depends on the supplied DLL, and see what it loads that I don't recognise.

                    Steve S Developer for hire

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #9

                    Steve S wrote:

                    but my point is that it must be using some user-level mechanism which does not depend on a manufacturer-specific driver,

                    That's what the device's SDK is for. There are no "generic" communication methods with any USB devices.

                    Steve S wrote:

                    My next obvious step would be to run Depends on the supplied DLL, and see what it loads that I don't recognise.

                    Depends can tell you what functions a .DLL exports and will give you the function names, but it can NOT give you the number of parameters and the data types of those parameters. The only thing that can give you that is the docs on the SDK.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007

                    S 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      Steve S wrote:

                      but my point is that it must be using some user-level mechanism which does not depend on a manufacturer-specific driver,

                      That's what the device's SDK is for. There are no "generic" communication methods with any USB devices.

                      Steve S wrote:

                      My next obvious step would be to run Depends on the supplied DLL, and see what it loads that I don't recognise.

                      Depends can tell you what functions a .DLL exports and will give you the function names, but it can NOT give you the number of parameters and the data types of those parameters. The only thing that can give you that is the docs on the SDK.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007

                      S Offline
                      S Offline
                      Steve S
                      wrote on last edited by
                      #10

                      Dave Kreskowiak wrote:

                      Depends can tell you what functions a .DLL exports and will give you the function names, but it can NOT give you the number of parameters and the data types of those parameters. The only thing that can give you that is the docs on the SDK.

                      Very true, and in this case, since it also gives the names of functions that the DLL imports, it can tell you that it's using SETUPAPI functions, and functions from HID. The latter is what the library appears to be using for communication. However, we're now well off the original poster's track, although I may come back at a much later date with an article on how the supplied DLL does it's USB communication without a specific device driver :)

                      Steve S Developer for hire

                      D 1 Reply Last reply
                      0
                      • S Steve S

                        Dave Kreskowiak wrote:

                        Depends can tell you what functions a .DLL exports and will give you the function names, but it can NOT give you the number of parameters and the data types of those parameters. The only thing that can give you that is the docs on the SDK.

                        Very true, and in this case, since it also gives the names of functions that the DLL imports, it can tell you that it's using SETUPAPI functions, and functions from HID. The latter is what the library appears to be using for communication. However, we're now well off the original poster's track, although I may come back at a much later date with an article on how the supplied DLL does it's USB communication without a specific device driver :)

                        Steve S Developer for hire

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #11

                        Steve S wrote:

                        although I may come back at a much later date with an article on how the supplied DLL does it's USB communication without a specific device driver

                        Sure, with the SETUPAPI, a bunch of DeviceIo calls, and the documentation on what the device's commands and responses are. It's generic, but only to a point. Eventually, you have to get into the specifics of the device.

                        A guide to posting questions on CodeProject[^]
                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                             2006, 2007

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups