Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-18
5
Medium Priority
?
1,155 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 400 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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. …
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 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…

715 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