PORTS Forum

Ports and Interfaces => USB => Topic started by: cool on July 04, 2011, 03:06:17 am

Title: functions for communiating with USB
Post by: cool on July 04, 2011, 03: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
Title: Re: functions for communiating with USB
Post by: Jan Axelson on July 04, 2011, 10: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.janaxelson.com/usbfaq.htm

I have Visual Studio HID examples here:

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

WinUSB examples here:

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

COM port including USB virtual COM port here:

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

Jan
Title: Re: functions for communiating with USB
Post by: cool on July 04, 2011, 11: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

Title: Re: functions for communiating with USB
Post by: Jan Axelson on July 05, 2011, 12:14:13 am
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.janaxelson.com/serport.htm#my_example_code

Jan