0
Answer

Checking for dropped connection with SerialPort class

Mihcael

Mihcael

13y
8.3k
1
I'm using the SerialPort class in c#/Visual Studio to monitor data coming in from COM port 10. The problem I am having is when the device sending data to port 10 is disconnected or switched off. Using the 'isOpen' method does not work, as it will still return true as the instance of SerialPort still thinks there is a connection.

I've tried looping through SerialPort.portNames, and that doesn't work either. It simply says that all the ports are closed.

How can I test for when the connection is dropped?

Thanks for your help.

Michael