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:
Matthew Kennedy 2022-02-15 21:21:25 -08:00 committed by GitHub
parent 2751a920f7
commit 1cd5421c20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -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.