Only send "Data Written" events if enabled by user

This commit is contained in:
hedgecrw85 2018-08-01 10:25:13 -05:00
parent d03189929b
commit 54fba1c9f4
1 changed files with 2 additions and 1 deletions

View File

@ -1171,7 +1171,8 @@ public final class SerialPort
}
case LISTENING_EVENT_DATA_WRITTEN:
{
userDataListener.serialEvent(new SerialPortEvent(SerialPort.this, LISTENING_EVENT_DATA_WRITTEN));
if ((eventFlags & LISTENING_EVENT_DATA_WRITTEN) > 0)
userDataListener.serialEvent(new SerialPortEvent(SerialPort.this, LISTENING_EVENT_DATA_WRITTEN));
break;
}
default: