When setting notifyOnOutputEmpty to true, no serial port events seem to be fired anymore.
When I do not set it to true, I receive serial port events when CTS or RTS changes and when data is available, but if I do set it to true I do not receive any event anymore.
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(portName);
SerialPort port = portId.open("Me", 5000);
port.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
//port.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT);
port.setOutputBufferSize(1);
port.setInputBufferSize(1);
port.enableReceiveTimeout(receiveTimeOutMillis);
port.notifyOnDataAvailable(true);
//port.notifyOnOutputEmpty(true); // turning this on seems to disable other events
port.notifyOnCTS(true);
port.notifyOnDSR(true);
port.setRTS(false);
port.addEventListener(eventHandler);
When setting
notifyOnOutputEmpty
totrue
, no serial port events seem to be fired anymore.When I do not set it to true, I receive serial port events when CTS or RTS changes and when data is available, but if I do set it to
true
I do not receive any event anymore.