Com0 in the Comm ports of the Compact Framework

  • Thread starter Thread starter lmarksman
  • Start date Start date
L

lmarksman

I am attempting to use Com0 with a serial port component in the C#
Compact Framework. I'm just trying to broadcast Raw IR. But when I try
to open the port I receive a message "The given port name is invalid.
It may be a valid port but not a serial port.". I've installed the
OpenNetCF dll that creates Com0.

Does Microsoft just not allow a Com0 for the Compact Framework. If it
does, does anyone have a suggestion as how to code this. I can post my
sample code if someone would like to see the way I'm trying it.

lmarksman
 
I have tried to use it as COM0: but response I receive when I to a
port.Open() is "The given port name is invalid. It may be a valid
port, but not a serial port.". I'm thinking Microsoft does not support
COM0: in the Compact Framework. Any thoughts?



lmarksman
 
Hi,

Com0: is supported on some devices (so I've been told), though none that I
have use it. I added a PortName property to my CFSerialIO (dwonload from my
homepage) that allows you to specify this a a string. If PortOpen succeeds,
then the name is "OK." If not, then you have some more work to do.

I made this change for a correspondent, and he went away... I presume
"happy?" I seem to remember that it solved his problem.

One thing to make sure is that you are not using the Emulator. If you are,
then Com0 in the emulator maps to Com1 in code. Likewise, Com1 in the
emulator maps to Com2 in code. I assume that you really are not using the
emulator, because raw Ir make no sense there.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
Back
Top