public class UARTEvent extends PeripheralEvent
UARTEvent
class encapsulates events fired by peripherals that implement the UART
interface.UART
,
UARTEventListener
Modifier and Type | Field and Description |
---|---|
static int |
INPUT_BUFFER_OVERRUN
Event ID indicating that input buffer overrun.
|
static int |
INPUT_DATA_AVAILABLE
Event ID indicating that input data is available for reading.
|
static int |
OUTPUT_BUFFER_EMPTY
Event ID indicating that the output buffer is empty and that additional data may be written.
|
count, lastTimeStamp, lastTimeStampMicros, peripheral, timeStamp, timeStampMicros
Constructor and Description |
---|
UARTEvent(UART uart,
int id)
Creates a new
UARTEvent with the specified value and time-stamped with the current time. |
UARTEvent(UART uart,
int id,
long timeStamp,
int timeStampMicros)
Creates a new
UARTEvent with the specified value and timestamp. |
Modifier and Type | Method and Description |
---|---|
int |
getID()
Returns this event ID.
|
getCount, getLastTimeStamp, getLastTimeStampMicros, getPeripheral, getTimeStamp, getTimeStampMicros
public static final int INPUT_BUFFER_OVERRUN
public static final int INPUT_DATA_AVAILABLE
public static final int OUTPUT_BUFFER_EMPTY
public UARTEvent(UART uart, int id)
UARTEvent
with the specified value and time-stamped with the current time.uart
- the source uart.id
- the event ID: INPUT_DATA_AVAILABLE
, INPUT_BUFFER_OVERRUN
or
OUTPUT_BUFFER_EMPTY
.java.lang.NullPointerException
- if uart
is null
.java.lang.IllegalArgumentException
- if id
is not a valid event ID.public UARTEvent(UART uart, int id, long timeStamp, int timeStampMicros)
UARTEvent
with the specified value and timestamp.uart
- the source uart.id
- the event ID: INPUT_DATA_AVAILABLE
, INPUT_BUFFER_OVERRUN
or
OUTPUT_BUFFER_EMPTY
.timeStamp
- the timestamp (in milliseconds).timeStampMicros
- the additional microseconds to the timestamp.java.lang.NullPointerException
- if uart
is null
.java.lang.IllegalArgumentException
- if id
is not a valid event ID or if timeStamp
or timeStampMicros
is negative.public int getID()
INPUT_DATA_AVAILABLE
, INPUT_BUFFER_OVERRUN
or
OUTPUT_BUFFER_EMPTY
.Copyright (c) 1990, 2013, Oracle and/or its affiliates. All rights reserved.