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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. USB Port Identification

USB Port Identification

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 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.
  • K Offline
    K Offline
    koumodaki
    wrote on last edited by
    #1

    I have 3 USB ports on my PC. I am using one for my keyboard and other is connected to a mouse and the 3rd one is free. But the device manager of my PC shows 5 USB Universal Host controllers 27C8,27C9,27CA,27CB & 27CC. I will be connecting a controller board to the free USB port. I need to use CreateFile(), ReadFile() and WriteFile() to read and write to the USB port. Now how do I identify the free port?

    C 1 Reply Last reply
    0
    • K koumodaki

      I have 3 USB ports on my PC. I am using one for my keyboard and other is connected to a mouse and the 3rd one is free. But the device manager of my PC shows 5 USB Universal Host controllers 27C8,27C9,27CA,27CB & 27CC. I will be connecting a controller board to the free USB port. I need to use CreateFile(), ReadFile() and WriteFile() to read and write to the USB port. Now how do I identify the free port?

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      You don't access the USB port the same way you access a serial port (so, you don't specify the "port name" to the CreateFile function). Instead you get a handle to a device driver which will communicate with the USB device. So, you need to give the identification of this driver to the CreateFile function. This is of course totally dependant of which USB device you are trying to communicate with. Normally, this should be described in the documentation of the controller board.

      Cédric Moonen Software developer
      Charting control [v1.3]

      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