public final class SerialPortParameters
extends java.lang.Object
Parameters are stored as public variables so that they can be accessed and read from any class.
Modifier and Type | Field and Description |
---|---|
int |
baudRate |
int |
dataBits |
int |
flowControl |
int |
parity |
int |
readTimeout |
int |
stopBits |
Constructor and Description |
---|
SerialPortParameters(int baudRate,
int dataBits,
int stopBits,
int parity,
int flowControl,
int readTimeout)
Class constructor.
|
public final int baudRate
public final int dataBits
public final int stopBits
public final int parity
public final int flowControl
public final int readTimeout
public SerialPortParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl, int readTimeout)
SerialPortParameters
object
with the given parameters.baudRate
- Baud rate.dataBits
- Data bits, one of SerialPort.DATABITS_5
,
SerialPort.DATABITS_6
,
SerialPort.DATABITS_7
, and
SerialPort.DATABITS_8
.stopBits
- Stop bits, one of SerialPort.STOPBITS_1
,
SerialPort.STOPBITS_2
, and
SerialPort.STOPBITS_1_5
.parity
- Parity, one of SerialPort.PARITY_NONE
,
SerialPort.PARITY_ODD
,
SerialPort.PARITY_EVEN
,
SerialPort.PARITY_MARK
, and
SerialPort.PARITY_SPACE
.flowControl
- Flow control, one of
SerialPort.FLOWCONTROL_NONE
,
SerialPort.FLOWCONTROL_RTSCTS_IN
,
SerialPort.FLOWCONTROL_RTSCTS_OUT
,
SerialPort.FLOWCONTROL_XONXOFF_IN
, and
SerialPort.FLOWCONTROL_XONXOFF_OUT
.readTimeout
- Serial connection read timeout.java.lang.IllegalArgumentException
- If baudRate < 0
or
if dataBits < 0
or
if stopBits < 0
or
if parity < 0
or
if flowControl < 0
or
if readTimeout < 0
.SerialPort.DATABITS_5
,
SerialPort.DATABITS_6
,
SerialPort.DATABITS_7
,
SerialPort.DATABITS_8
,
SerialPort.FLOWCONTROL_NONE
,
SerialPort.FLOWCONTROL_RTSCTS_IN
,
SerialPort.FLOWCONTROL_RTSCTS_OUT
,
SerialPort.FLOWCONTROL_XONXOFF_IN
,
SerialPort.FLOWCONTROL_XONXOFF_OUT
,
SerialPort.PARITY_EVEN
,
SerialPort.PARITY_MARK
,
SerialPort.PARITY_NONE
,
SerialPort.PARITY_ODD
,
SerialPort.PARITY_SPACE
,
SerialPort.STOPBITS_1
,
SerialPort.STOPBITS_1_5
,
SerialPort.STOPBITS_2