Package jmri.jmrix.purejavacomm
Class SerialPort
- java.lang.Object
-
- jmri.jmrix.purejavacomm.SerialPort
-
public class SerialPort extends java.lang.Object
Serial port.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DATABITS_8
static int
FLOWCONTROL_NONE
static int
FLOWCONTROL_RTSCTS_IN
static int
FLOWCONTROL_RTSCTS_OUT
static int
PARITY_EVEN
static int
PARITY_NONE
static int
PARITY_ODD
static int
STOPBITS_1
static int
STOPBITS_2
-
Constructor Summary
Constructors Constructor Description SerialPort(SerialPort serialPort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventListener(SerialPortEventListener listener)
void
close()
int
getBaudRate()
java.io.InputStream
getInputStream()
java.io.OutputStream
getOutputStream()
int
getReceiveTimeout()
boolean
isCD()
boolean
isCTS()
boolean
isDSR()
boolean
isDTR()
boolean
isReceiveTimeoutEnabled()
boolean
isRI()
boolean
isRTS()
void
notifyOnDataAvailable(boolean value)
void
setDTR(boolean value)
void
setFlowControlMode(int mode)
void
setRTS(boolean value)
void
setSerialPortParams(int baudRate, int dataBits, int stopBits, int parity)
-
-
-
Field Detail
-
DATABITS_8
public static final int DATABITS_8
- See Also:
- Constant Field Values
-
PARITY_NONE
public static final int PARITY_NONE
- See Also:
- Constant Field Values
-
PARITY_ODD
public static final int PARITY_ODD
- See Also:
- Constant Field Values
-
PARITY_EVEN
public static final int PARITY_EVEN
- See Also:
- Constant Field Values
-
STOPBITS_1
public static final int STOPBITS_1
- See Also:
- Constant Field Values
-
STOPBITS_2
public static final int STOPBITS_2
- See Also:
- Constant Field Values
-
FLOWCONTROL_NONE
public static final int FLOWCONTROL_NONE
- See Also:
- Constant Field Values
-
FLOWCONTROL_RTSCTS_IN
public static final int FLOWCONTROL_RTSCTS_IN
- See Also:
- Constant Field Values
-
FLOWCONTROL_RTSCTS_OUT
public static final int FLOWCONTROL_RTSCTS_OUT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SerialPort
public SerialPort(SerialPort serialPort)
-
-
Method Detail
-
setSerialPortParams
public void setSerialPortParams(int baudRate, int dataBits, int stopBits, int parity) throws UnsupportedCommOperationException
-
addEventListener
public void addEventListener(SerialPortEventListener listener) throws java.util.TooManyListenersException
- Throws:
java.util.TooManyListenersException
-
notifyOnDataAvailable
public void notifyOnDataAvailable(boolean value)
-
setFlowControlMode
public void setFlowControlMode(int mode) throws UnsupportedCommOperationException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException
- Throws:
java.io.IOException
-
getBaudRate
public int getBaudRate()
-
setDTR
public void setDTR(boolean value)
-
setRTS
public void setRTS(boolean value)
-
isDTR
public boolean isDTR()
-
isRTS
public boolean isRTS()
-
isDSR
public boolean isDSR()
-
isCTS
public boolean isCTS()
-
isCD
public boolean isCD()
-
isRI
public boolean isRI()
-
isReceiveTimeoutEnabled
public boolean isReceiveTimeoutEnabled()
-
getReceiveTimeout
public int getReceiveTimeout()
-
close
public void close()
-
-