


I have start and end characters which I listen for and all of this works fine, until the bluetooth device goes out of range and effectively disconnects leaving the serial port still open. The serial port is a bluetooth serial port, it is talking to a bluetooth radio which in turn talks to a microcontroller.

So is it possible to detect whether a port is open and alive so that I can leave the port open and only close and re-open it when I detect that the connected device has gone away. It's highly possible that the serial device disconnected from an opened port, and of course this is going to cause problems. My initial idea was to open the port, read the data and then close it again, The problem is, that opening a serial port can take up to 4 seconds and I may need to read from up to 8 ports, so opening and closing the port is not practical for each cycle. I am writing a realbasic console application which polls several serial ports for data and saves the results to a database.
