Hi,

I think microsoft does provides generic USB drivers. But I wonder how to
access USB ports from my C program ?
Is there any API's available for USB I/O ?? (...like one provided for Serial
Communication)
e.g. how do I enumerate number of USB Ports on my system programmatically ?
Or do we have to make a custom device driver for the same ?

Thanks & Regards,
Atur Shah

Re: USB Port I/O by Robert

Robert
Fri Nov 14 02:42:50 CST 2003

aturshah wrote:

> Hi,
>
> I think microsoft does provides generic USB drivers. But I wonder how to
> access USB ports from my C program ?
> Is there any API's available for USB I/O ?? (...like one provided for Serial
> Communication)
> e.g. how do I enumerate number of USB Ports on my system programmatically ?
> Or do we have to make a custom device driver for the same ?
>
> Thanks & Regards,
> Atur Shah

This is the classic USB newbie question.
The bus itself is invisible. Trying to talk to the USB port is like
tying to talk to your ethernet port.
You always addess devices. So you can enumerate specific USB devices and
talk to them.
You talk to the driver of the device (either class driver or
manufacturers driver).


Re: USB Port I/O by aturshah

aturshah
Fri Nov 14 05:05:37 CST 2003

Hi,

We are changing the hardware currently controlled via RS232 to USB.
We have control over both the ends i.e. writing device drivers as well as
software applications.
We are aware that changes to the hardware may be required.

I have following questions :~

1. First, need some clarification on Serial Ports and USB concepts.

- USB is not a serial line but a serial bus. So when we say USB we always
talk *for* a specific device.

- We can use USB - Serial Bridge to get a virtual Serial Port and then USB
should be completely transparent.

- e.g. Currently our device has RS232 Serial interface. If we change our
hardware to be controlled via USB and connect via USB-Serial Bridge,
effectively the user software should remain same. Because that will
essentially be talking with Serial Port of the Bridge.

2. Does Windows 98/2k provide support for USB Communication without writing
kernel mode driver? If yes..How ?

3. If no...Base USB drivers are provided by Microsoft. So we require to
build is a USB kernel mode function/filter driver for our usb device ?

Your suggestions/pointers are highly appreciated.

Thanks & Regards,
-----------------
Atur Shah


"aturshah" <atur@vigorsoft.com> wrote in message
news:%23kXu%23ooqDHA.372@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I think microsoft does provides generic USB drivers. But I wonder how to
> access USB ports from my C program ?
> Is there any API's available for USB I/O ?? (...like one provided for
Serial
> Communication)
> e.g. how do I enumerate number of USB Ports on my system programmatically
?
> Or do we have to make a custom device driver for the same ?
>
> Thanks & Regards,
> Atur Shah



Re: USB Port I/O by Maxim

Maxim
Sat Nov 15 17:29:33 CST 2003

Yes you need a driver to expose the USB device as a file. The USB stack
itself does not do this, it is for drivers only, and not for user mode apps.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


"aturshah" <atur@vigorsoft.com> wrote in message
news:#kXu#ooqDHA.372@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I think microsoft does provides generic USB drivers. But I wonder how to
> access USB ports from my C program ?
> Is there any API's available for USB I/O ?? (...like one provided for Serial
> Communication)
> e.g. how do I enumerate number of USB Ports on my system programmatically ?
> Or do we have to make a custom device driver for the same ?
>
> Thanks & Regards,
> Atur Shah
>
>
>
>
>
>
>



Re: USB Port I/O by Kirk

Kirk
Sun Nov 16 21:29:38 CST 2003

"aturshah" <atur@vigorsoft.com> wrote in message
news:%23hcky5pqDHA.2692@TK2MSFTNGP09.phx.gbl...
> 2. Does Windows 98/2k provide support for USB Communication without
writing
> kernel mode driver? If yes..How ?

If you hardware can be used with one of the existing class drivers then you
probably don't need anything else. Windows XP comes with about 12 class
drivers for USB devices. Windows 98 OTOH includes support for only 3 - HID,
Audio and Printing.

Otherwise you need to write your own class driver.

-Kirk



Re: USB Port I/O by valentin

valentin
Mon Nov 24 20:47:45 CST 2003

rs232 conforms to CDC class because this is not a target device but a port
(a tunnel, a transparent proxy). MS has a driver called usbser.sys that can
host USB CDC device as a virtual com port. http://www.lvr.com/usbfaq.htm
This is not an ideal though (MS does not like developers).

MS has a USBView demo application with a corresponding (generic) driver.
With this driver you can enumerate and access any device on the bus. The
driver is built into OS, specifically into host controller drivers and
accessed by device IO control requests.

None of the drivers is supported by MS, none is documented.

Good luck.