public final class SerialComLineErrors extends Object
An instance of this class should be passed if the application wish to know whether parity, framing, overrun etc errors has happened on serial port while receiving data or not. Pass instance of this class to readBytes() method.
| Modifier and Type | Field and Description |
|---|---|
static int |
ERR_FRAME
The value indicating framing error while receiving data at serial port.
|
static int |
ERR_OVERRUN
The value indicating overrun error while receiving data at serial port.
|
static int |
ERR_PARITY
The value indicating parity error while receiving data at serial port.
|
static int |
RCV_BREAK
The value indicating that a break condition has been received at the serial port.
|
| Constructor and Description |
|---|
SerialComLineErrors()
Allocate and reset the errors bit mask.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasAnyErrorOccurred()
Tells whether any error has occurred while receiving data at serial port or not.
|
boolean |
hasFramingErrorOccurred()
Tells whether framing error has occurred while receiving data at serial port or not.
|
boolean |
hasOverrunErrorOccurred()
Tells whether overrun error has occurred while receiving data at serial port or not.
|
boolean |
hasParityErrorOccurred()
Tells whether parity error has occurred while receiving data at serial port or not.
|
boolean |
isBreakReceived()
Tells whether a break condition is seen at serial port or not.
|
void |
resetLineErrors()
Reset the errors bit mask.
|
public static final int ERR_PARITY
The value indicating parity error while receiving data at serial port. Integer constant with value 0x01.
public static final int ERR_FRAME
The value indicating framing error while receiving data at serial port. Integer constant with value 0x02.
public static final int ERR_OVERRUN
The value indicating overrun error while receiving data at serial port. Integer constant with value 0x03.
public static final int RCV_BREAK
The value indicating that a break condition has been received at the serial port. Integer constant with value 0x04.
public SerialComLineErrors()
Allocate and reset the errors bit mask.
public void resetLineErrors()
Reset the errors bit mask.
public boolean hasParityErrorOccurred()
Tells whether parity error has occurred while receiving data at serial port or not.
Linux does not differentiate between framing and parity errors. So if either error occurs both parity and framing error will be set.
public boolean hasFramingErrorOccurred()
Tells whether framing error has occurred while receiving data at serial port or not.
Linux does not differentiate between framing and parity errors. So if either error occurs both parity and framing error will be set.
public boolean hasOverrunErrorOccurred()
Tells whether overrun error has occurred while receiving data at serial port or not.
public boolean hasAnyErrorOccurred()
Tells whether any error has occurred while receiving data at serial port or not. This method can be used to save time that would have been spent in checking individual errors. Typically applications discard data read from serial port if any error occurs.
public boolean isBreakReceived()
Tells whether a break condition is seen at serial port or not.
Copyright © 2017. All rights reserved.