Hello ALL,

I m a biginner in WinCE 5.0, I don't know much about it.
My project is to write one diagnostic application for the USB. I.e to
check the functionality of the USB port like open the port, write some
data to the USB device, the Rad back and compare the data,etc.

Please let me know can i use the same CreateFile() function to check
whether USB port is there are not.

If "yes" tell me the first parameter that is required to give in the
CreateFile() function.

If "no" then tell me the function that will return me the USB_HANDLE.

Please guide me in finding the API to write the same code.

Thanks & Regards,

Nutty

Re: USB Diagnostic Application by Valter

Valter
Thu Sep 28 03:18:03 CDT 2006

nutty.sawant@gmail.com wrote in
news:1159416245.553629.275230@m73g2000cwd.googlegroups.com:

> Hello ALL,
>
> I m a biginner in WinCE 5.0, I don't know much about it.
> My project is to write one diagnostic application for the USB. I.e
> to check the functionality of the USB port like open the port,
> write some data to the USB device, the Rad back and compare the
> data,etc.
>
> Please let me know can i use the same CreateFile() function to
> check whether USB port is there are not.

USB "ports" cannot be accessed directly.
USB is a complex protocol and can support a "chain" of devices
connected directly through the USB host controller ports or via one
or more hubs.
You may have a USB host controller and in this case to exchange
information with a USB device you will have to open a "pipe" to one
of his endpoints (a device can have multiple input and output
endpoints) using the right transfer type (interrupt, block, control,
Isochronous) for that endpoint.
If your device has a USB device port it should be connected to a
host and you have to write the code to provide endpoints required by
the specific protocol you're going to support.
Windows CE provides some drivers that can be used to control devices
via USB host (mass-storage, RNDIS, printer, Human Interface Devices,
bluetooth dongles etc.) and also drivers to support some protocols
from the device side (mass-storage, RNDIS, activesync).
You will also need a low-level driver that will allow the high-level
layers of the OS to interact with your hardware controller. Usually
those drivers are provided by the device manufacturer (for embedded
processors) or support a standard (OHCI, UHCI etc.).

I suggest to read the "USB Devices" article in PB help and the links
it provides to have a more detailed explanation of how USB works and
how you can access it on Windows CE.

--
Valter Minute
(the reply address of this message is invalid)
(l'indirizzo di reply di questo messaggio non è valido)

Re: USB Diagnostic Application by nutty

nutty
Tue Oct 03 09:12:59 CDT 2006


Valter Minute wrote:

> nutty.sawant@gmail.com wrote in
> news:1159416245.553629.275230@m73g2000cwd.googlegroups.com:
>
> > Hello ALL,
> >
> > I m a biginner in WinCE 5.0, I don't know much about it.
> > My project is to write one diagnostic application for the USB. I.e
> > to check the functionality of the USB port like open the port,
> > write some data to the USB device, the Rad back and compare the
> > data,etc.
> >
> > Please let me know can i use the same CreateFile() function to
> > check whether USB port is there are not.
>
> USB "ports" cannot be accessed directly.
> USB is a complex protocol and can support a "chain" of devices
> connected directly through the USB host controller ports or via one
> or more hubs.
> You may have a USB host controller and in this case to exchange
> information with a USB device you will have to open a "pipe" to one
> of his endpoints (a device can have multiple input and output
> endpoints) using the right transfer type (interrupt, block, control,
> Isochronous) for that endpoint.
> If your device has a USB device port it should be connected to a
> host and you have to write the code to provide endpoints required by
> the specific protocol you're going to support.
> Windows CE provides some drivers that can be used to control devices
> via USB host (mass-storage, RNDIS, printer, Human Interface Devices,
> bluetooth dongles etc.) and also drivers to support some protocols
> from the device side (mass-storage, RNDIS, activesync).
> You will also need a low-level driver that will allow the high-level
> layers of the OS to interact with your hardware controller. Usually
> those drivers are provided by the device manufacturer (for embedded
> processors) or support a standard (OHCI, UHCI etc.).
>
> I suggest to read the "USB Devices" article in PB help and the links
> it provides to have a more detailed explanation of how USB works and
> how you can access it on Windows CE.
>
> --
> Valter Minute
> (the reply address of this message is invalid)
> (l'indirizzo di reply di questo messaggio non =E8 valido)


Hello,

Thanks for ur reply.
Please tell me the API to Access the USB poet i.e the api which will
return me the USB HANDLE.
Somewhere in the Platform Builder Help Menu, i have read that the
CreateFile Function is used to open the Usb Handle. Is it right??

In the open pipe API the first parameter is the USB_HANDLE. How to get
this parameter??

Please guide me...

Thanks & Regards,
Nutty


Re: USB Diagnostic Application by Valter

Valter
Tue Oct 03 10:00:42 CDT 2006

nutty.sawant@gmail.com wrote in
news:1159884779.883284.301570@i3g2000cwc.googlegroups.com:

[...]
> Thanks for ur reply.
> Please tell me the API to Access the USB poet i.e the api which
> will return me the USB HANDLE.

AFAIK there is no such an API.

> Somewhere in the Platform Builder Help Menu, i have read that the
> CreateFile Function is used to open the Usb Handle. Is it right??
>
> In the open pipe API the first parameter is the USB_HANDLE. How to
> get this parameter??

Pipes can be opened by drivers loaded by USBD.
In the attach function you'll receive the handle and the pointers to
the functions that you may call to do USB operations.
That means that you must have a driver and that this driver must be
loaded when a specific device (or a device belonging to a specific
USB class) is plugged into one of the device's host ports or in a
hub.
AFAIK there's no a "hook" mechanism to control all the USB devices
or to connect to a specific port on the host.

--
Valter Minute
(the reply address of this message is invalid)
(l'indirizzo di reply di questo messaggio non è valido)

Re: USB Diagnostic Application by nutty

nutty
Wed Oct 04 23:27:01 CDT 2006


Valter Minute wrote:

> nutty.sawant@gmail.com wrote in
> news:1159884779.883284.301570@i3g2000cwc.googlegroups.com:
>
> [...]
> > Thanks for ur reply.
> > Please tell me the API to Access the USB poet i.e the api which
> > will return me the USB HANDLE.
>
> AFAIK there is no such an API.
>
> > Somewhere in the Platform Builder Help Menu, i have read that the
> > CreateFile Function is used to open the Usb Handle. Is it right??
> >
> > In the open pipe API the first parameter is the USB_HANDLE. How to
> > get this parameter??
>
> Pipes can be opened by drivers loaded by USBD.
> In the attach function you'll receive the handle and the pointers to
> the functions that you may call to do USB operations.
> That means that you must have a driver and that this driver must be
> loaded when a specific device (or a device belonging to a specific
> USB class) is plugged into one of the device's host ports or in a
> hub.
> AFAIK there's no a "hook" mechanism to control all the USB devices
> or to connect to a specific port on the host.
>
> --
> Valter Minute
> (the reply address of this message is invalid)
> (l'indirizzo di reply di questo messaggio non =E8 valido)


Thanks a lot!!!!

Sorry, but i really don't understand the meaning of "In the attach
function you'll receive the handle and the pointers to the functions
that you may call to do USB operations"
My project is to check the functionality of USB drive, whether it is
working or not?
I m using pen drive (USB stick) as a USB device. After connecting this
pen drive,it should be detected by the WinCE device, then i wanted to
write something on that pen drive, read from it,and compare the data
etc..For that i wanted to write the application.
But i don't understand how to detect the USB device, how to write in
that,read etc.....
Please let me the API required to do the above test like Dtection,
write operation and read operation.....
Please guide me....
Thanks AND Reagards,
Nutty.