Solved

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

Posted on 2004-08-18
5
1,146 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
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

770 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