Exclusive Serial Port Access on OSX

I am working on an open source program that uses gnu.io ( RXTX ) to talk to the microcontroller via a USB serial port. The application works on Windows, Linux and OSX. It uses gnu.io for portable access to the serial port. One Macbook user published a magazine demonstrating two things:

  • While the application has a serial port, something causes the RTS to pulse, resetting the microcontroller.
  • While the application has a serial port, opening something temporarily changes the transmission speed, causing garbage to appear on the input. (Usually, this combination of microcontrollers / firmware / USB is not sensitive to the “linear noise” style that is characteristic of poor baud rates).
  • This happens periodically when the application is idle (reaction / registration when spontaneous messages appear after an RTS reset caused)

I suspect that some other program sometimes opens the same serial port (for example, searching for a connected device). How to prevent this on OSX?

+6
source share
1 answer

as far as I know, RXTX does not allow anyone to use the Serial port that it uses, and throws an exception if the port is already in use when it tries to open it. sounds like an rxtx error to me

+2
source

Source: https://habr.com/ru/post/885573/


All Articles