serial disconnect event (#3939)
* connector version bump (#3914) Co-authored-by: rusefillc <sdfsdfqsf2334234234> * be loud about disconnect events Co-authored-by: rusefillc <48498823+rusefillc@users.noreply.github.com>
This commit is contained in:
parent
2751a920f7
commit
1cd5421c20
|
@ -95,13 +95,19 @@ public class SerialIoStream extends AbstractIoStream {
|
|||
|
||||
@Override
|
||||
public int getListeningEvents() {
|
||||
return SerialPort.LISTENING_EVENT_DATA_AVAILABLE;
|
||||
return SerialPort.LISTENING_EVENT_DATA_AVAILABLE | SerialPort.LISTENING_EVENT_PORT_DISCONNECTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialEvent(SerialPortEvent event) {
|
||||
if (Bug3923.obscene)
|
||||
log.info("serialEvent " + event.getEventType());
|
||||
|
||||
if (event.getEventType() == SerialPort.LISTENING_EVENT_PORT_DISCONNECTED) {
|
||||
System.out.println("got event SerialPort.LISTENING_EVENT_PORT_DISCONNECTED");
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getEventType() != SerialPort.LISTENING_EVENT_DATA_AVAILABLE)
|
||||
return;
|
||||
if (isFirstEvent) {
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue