m_Port.notifyOnOutputEmpty(true);
m_Port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN + SerialPort.FLOWCONTROL_XONXOFF_OUT);
m_Port.setSerialPortParams(speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
final boolean[] stop = { false };
m_T0 = System.currentTimeMillis();
m_Port.addEventListener(new SerialPortEventListener() {
public void serialEvent(SerialPortEvent event) {
try {
if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
byte[] buffer = new byte[m_In.available()];
int n = m_In.read(buffer);