I have created application that sends/receives messages using com port. I use rxtx lib for this purpose. When application starts I open com port like:
String comportidentifier = "/dev/ttyS0";
CommPortIdentifier portIdentifier = null;
portIdentifier = CommPortIdentifier.getPortIdentifier(comportidentifier);
if (portIdentifier.isCurrentlyOwned()) {
JOptionPane.showMessageDialog(null, "port in use");
} else {
SerialPort serialPort = (SerialPort) portIdentifier.open("ReadComPort", 200);
}
And I close it when programm finishes job.
Unexpectedly I found that my comport (the one I have opened) transmits some strange command my code does't sends. I'm usig several libraryes in my code and I don't pass com port variable to them. The only description is that something in system is alsow has opened port and is sends command. But is this possible if I already have opened com port? I suppose that when I have opened port nobody can do that also until I close it. How to describe this situation?
When I have change port to /dev/ttyS1 unexpected command was not transmitted.