Solved

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

Posted on 2004-08-18
5
1,141 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
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:SteH
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now