Solved

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

756 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