Re: USB Testing
- From: "Sha Viswanathan [MSFT]" <sharathv@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 13:53:15 -0700
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?
.
- References:
- Re: USB Testing
- From: Sha Viswanathan [MSFT]
- Re: USB Testing
- From: John Peters
- Re: USB Testing
- Prev by Date: Re: Extract CAB file to original files
- Next by Date: Re: Error in Sysgen: fatal error u1077 'cefilter'
- Previous by thread: Re: USB Testing
- Next by thread: OEMSetAlarmTime causes a problem - SOS
- Index(es):
Relevant Pages
|
Loading