Re: USB Testing



No problem John.

So, I know it shows up as "Other Devices/Generic Serial", not "Ports" as one
would expect, but I am pretty sure (Maybe a good question for the
device.drivers XP forum) that the device does indeed have a COM port
address. I have no idea if the port is displayed in a GUI or is in the
registry somewhere but I'll try to find out. For now you should try to
accesses it assuming that the addresses autoincrement (So if your PC has a
COM1 and COM2, just give COM3 a try).

Trying to do a CreateFile in XP...As I said above, just try L"COM3:". Also,
beware that your parameters to CreateFile seem out of order (GENERIC_READ
should come before FILE_SHARE_READ). Look at MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp)
for a CreateFile reference.

Let's step back here for a sec - I see you're trying to have your own
desktop app talk over USB. Before I had you do the registry switching, when
you were using the standard WCEUSBSH driver, did you know you could have
accessed it by calling a CreateFile on L"\\\\.\\WCEUSBSH001"?

-Sha Viswanathan
This posting is provided "AS IS" with no warranties, and confers no rights.


"John Peters" <JohnPeters@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FA94992F-72A4-49FC-B84D-F57A22951C91@xxxxxxxxxxxxxxxx
Thanks for the response!

OK, I added the
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\USBSER_Class] section to
my
Platform.reg and swapped the DeviceArrayIndex with the Serial_Class entry.
XP does recognize it as a new device ("Generic Serial"), but XP still
doesn't
treat it like a COM port. In fact, it shows up in my XP device manager as
"Other Devices/Generic Serial" and not under "Ports" like I would expect.
What am I forgetting?

As for using CreateFile() from XP, I used the device ID for the USB
connection:

::CreateFile(
L"\??\USB#Vid_045e&Pid_00ce#5&1f877be2&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}",
FILE_SHARE_READ,
GENERIC_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);

Not sure if that was the right thing to do. I was hoping I could just use
::CreateFile( L"COM3:", ... )


"Sha Viswanathan [MSFT]" wrote:

Our serial driver, by default, will send over a VID/PID to XP that causes
WCEUSBSH driver to load. Wceusbsh does not expose "USB Serial"
connections
as COM ports. There is another driver called usbser that does allow this,
but you'll need to change some registry keys to get it to work.

In public\common\oak\files\common.reg you'll find:
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Serial_Class]
and
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\USBSER_Class]

You'll need to swap the "DeviceArrayIndex" values to get one to load
over
the other.

Also, CreateFile is the way to go. What are your parameters?

-Sha Viswanathan
This posting is provided "AS IS" with no warranties, and confers no
rights.







"John Peters" <JohnPeters@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F599B9B0-05D4-4DE7-8EB8-50897981EC5C@xxxxxxxxxxxxxxxx
Hi All,

I've written a USB client driver and I've got the USBFN Serial function
driver using. It detects cable connects/disconnects/etc. When I
connect
our
WinCE device to a PC I see it show up as "Microsoft USB Sync" in XP.

Now, to test it, I'd like to have the PC send data to the device. I
can't
seem to figure out how to do this, though. I've tried using CreateFile
with
the device ID, but I keep getting "Invalid Parameter" errors. Can I
open
the
device this way?

Another question, since it's the serial class function driver,
shouldn't
it
show up as a serial device on the XP machine? I would expect it to
show
up
as a new COM port, but this is not happening. Is this just wishful
thinking?









.



Relevant Pages

  • USB BADPAD Quirk broken again
    ... PCI: PCI BIOS revision 2.10 entry at 0xfb240, ... Uniform Multi-Platform E-IDE driver Revision: ... usb.c: new USB bus registered, ... Port indicators are not supported ...
    (Linux-Kernel)
  • Re: Linux 2.4.23-pre6
    ... My USB 'not working' problem still exists. ... Pin 2-19 already programmed ... Journalled Block Device driver loaded ... hub.c: individual port over-current protection ...
    (Linux-Kernel)
  • [2.4] USB is broken
    ... I compiled and booted 2.4.23-pre5 this morning, and my USB doesn't work. ... Pin 2-19 already programmed ... Journalled Block Device driver loaded ... hub.c: individual port over-current protection ...
    (Linux-Kernel)
  • Re: Oh for a back door ...
    ... info and Google took me to a USB utility / test app that replaced the ... Windows USB driver. ... You wouldn't think there was much to it, being a serial port. ...
    (uk.comp.sys.mac)
  • Re: Can a USB driver exposed functions like RS232 COM port?
    ... I mean a Serial Appliation S/W talk to USB port? ... you can create a USB class driver which makes your cable ... If you would have all that but a serial port on hand held device, ...
    (microsoft.public.windowsce.platbuilder)

Loading