Ports
May 20, 2013, 03:03:14 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: functions for communiating with USB  (Read 1330 times)
cool
Member
*
Posts: 2


« on: July 04, 2011, 02:06:17 am »

Hi,

I am currently using VS2010. I would like to know what are the functions and header files to call for sending data to USB and receiving data from USB?

Please Advice

Thanks
« Last Edit: July 04, 2011, 03:16:00 am by cool » Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #1 on: July 04, 2011, 09:22:24 am »

From my USB FAQ:

How an application communicates with a USB device depends on the device driver that Windows has assigned to the device. The choice of driver in turn depends on finding a match between the information in the descriptors that Windows retrieves on device attachment or bootup and the information stored in the PC's INF files. Typically, the application doesn't have to know whether the device uses USB or another interface. For example, applications access files on a drive in the same way whether the drive uses USB, IEEE-1394, SCSI, ATAPI, or another interface. The interface-specific details are handled at a lower level. Some devices use drivers included with Windows. Others use a vendor-specific driver that he user must install.

http://www.lvr.com/usbfaq.htm

I have Visual Studio HID examples here:

http://www.lvr.com/hidpage.htm#MyExampleCode

WinUSB examples here:

http://www.lvr.com/winusb.htm

COM port including USB virtual COM port here:

http://www.lvr.com/serport.htm#my_example_code

Jan
« Last Edit: July 04, 2011, 09:34:42 am by Jan Axelson » Logged
cool
Member
*
Posts: 2


« Reply #2 on: July 04, 2011, 10:14:56 pm »

Hi,

I am currently using pob avoider II. I am using Visual Studio 2010.I am using USB serial port converter.May I know what header files to include and what is the functions to be used?

Please Advice

Thanks

Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #3 on: July 04, 2011, 11:14:13 pm »

Applications access a USB/serial adapter in the same way they access physical COM ports. The application doesn't have to know or care if the port is a physical serial port or a USB adapter.

Use the SerialPort class. See my examples here:

http://www.lvr.com/serport.htm#my_example_code

Jan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!