How to know if a serial port is busy

Firstly: I’m using MacOS X

Now the problem: I know how to set up serial ports, including selection from a drop-down list, etc. But how can I detect if one or more of the serial ports reported by the system is already in use by another application?

thanks,
Richard

I believe if you attempt to open a port already in use, the system will give you an error. Pretty sure that’s the way it works in Windows.

It doesn’t seem to work that way on MacOS as far as I can tell.

thanks,
Richard

[quote=100319:@Richard Francis]Firstly: I’m using MacOS X

Now the problem: I know how to set up serial ports, including selection from a drop-down list, etc. But how can I detect if one or more of the serial ports reported by the system is already in use by another application?
[/quote]

Normally, opening a port will change DataCarrierDetect, maybe other hardware signal pins. You may want to use the code example from http://documentation.xojo.com/index.php/Serial.DataCarrierDetect to monitor the pins of a serial port, and open it from another application, to see what kind of change occurs.

For more about hardware signals see RS-232 - Wikipedia

PS : I cannot test this for you, I have stopped using RS-232 a long time ago :wink:

http://opensource.the-meiers.org/

have a look at the bottom of the page. there is a xojo serial port testing app thats quite good for learning stuff