views:

430

answers:

2

Is there a way to tell whether the serial port has been opened successfully? The problem is that if the serial port not opened, no exception is thrown, and there is no way for users to know what the issue is.

Any input?

+1  A: 

The System.IO.Ports.SerialPort.IsOpen property tells you that.

cdonner
no it doesnt actually. I tried using it while faking serial port settings (making them intentionally incorrect). And IsOpen would return true.
gnomixa
That is odd. I have not used this on the CF.
cdonner
A: 

You might try the shared-source OpenNETCF serial port implementation. At least this way you'd have the source to change the behavior if it doesn't do what you want, and it's interface-compatible.

ctacke