Solved

How to send and receive data from an USB-port?

Posted on 2004-08-18
5
1,154 Views
Last Modified: 2008-01-09
Are there any tutorials/source on how to communicate with devices connected to the USB-port?
0
Comment
Question by:Tuomas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:SteH
ID: 11832496
Normally only drivers will comunnicate with the USB-bus. USB is a bus protocol which very different devices can use. What part of the bus specifications are used for that special device depends on it.

Or do you need to cumminicate with your own device and are about to write that driver?
0
 
LVL 1

Author Comment

by:Tuomas
ID: 11832632
I was wondering in general how could I communicate with a device through USB? Or any other port? How does the system work? How can I receive and send bits through any USB or any other port (like serial, com, or whatever). Sorry, now I'm changing the question a bit! :)
0
 
LVL 13

Expert Comment

by:SteH
ID: 11832778
Serial ports are mapped through the supplied driver to act as normal serial ports. You can find those numbers after installing the driver in the registry. No changes to existing code should be necessary except accessing the correct port number.

For storage device the driver lets them act like a built in hard disk or better removable drive. You communicate to them as if they were connected directly to your PC mainboard.
0
 
LVL 1

Author Comment

by:Tuomas
ID: 11833735
So where do I find these port numbers in the registry? Do you know any good source or tutorial on how to access these ports?
0
 
LVL 13

Accepted Solution

by:
SteH earned 100 total points
ID: 11838521
There is one article on MSDN on the basics of serial port programming:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp

and there are classes for accessing the serial port at codeguru and codeproject
http://www.codeproject.com/system/#Hardware+programming
http://www.codeguru.com/Cpp/I-N/network/serialcommunications/

And another link for checking for installed ports:
http://www.codeguru.com/Cpp/W-P/system/hardwareinformation/article.php/c5721/
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question