public interface SerialPortDataListener extends EventListener
|Modifier and Type||Method||Description|
Must be overridden to return one or more desired event constants for which the
Called whenever one of the serial port events specified by the
serialEvent(SerialPortEvent)callback should be triggered.
Valid event constants are:
Two or more events may be OR'd together to listen for multiple events; however, if
SerialPort.LISTENING_EVENT_DATA_AVAILABLE is OR'd with
SerialPort.LISTENING_EVENT_DATA_RECEIVED flag will take precedence.
Note that event-based write callbacks are only supported on Windows operating systems. As such, the
event will never be called on a non-Windows system.
void serialEvent(SerialPortEvent event)
Note that your implementation of this function should always perform as little data processing as possible, as the speed at which this callback will fire is at the mercy of the underlying operating system. If you need to collect a large amount of data, application-level buffering should be implemented and data processing should occur on a separate thread.