Package jmri.jmrix
Interface SerialPort
-
- All Known Implementing Classes:
FakeSerialPort
,JSerialPort
public interface SerialPort
Serial port
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SerialPort.Parity
Enumerate the possible parity choices
-
Field Summary
Fields Modifier and Type Field Description static int
LISTENING_EVENT_DATA_AVAILABLE
static int
NO_PARITY
static int
ONE_STOP_BIT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDataListener(SerialPortDataListener listener)
void
clearBreak()
void
clearDTR()
void
clearRTS()
void
closePort()
int
getBaudRate()
boolean
getCTS()
boolean
getDCD()
java.lang.String
getDescriptivePortName()
boolean
getDSR()
boolean
getDTR()
int
getFlowControlSettings()
java.io.InputStream
getInputStream()
int
getNumDataBits()
int
getNumStopBits()
java.io.OutputStream
getOutputStream()
SerialPort.Parity
getParity()
boolean
getRI()
boolean
getRTS()
void
setBaudRate(int baudrate)
void
setBreak()
boolean
setComPortTimeouts(int newTimeoutMode, int newReadTimeout, int newWriteTimeout)
void
setDTR()
void
setFlowControl(AbstractSerialPortController.FlowControl flow)
Configure the flow control settings.void
setNumDataBits(int bits)
void
setNumStopBits(int bits)
void
setParity(SerialPort.Parity parity)
void
setRTS()
java.lang.String
toString()
-
-
-
Field Detail
-
LISTENING_EVENT_DATA_AVAILABLE
static final int LISTENING_EVENT_DATA_AVAILABLE
- See Also:
- Constant Field Values
-
ONE_STOP_BIT
static final int ONE_STOP_BIT
- See Also:
- Constant Field Values
-
NO_PARITY
static final int NO_PARITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
addDataListener
void addDataListener(SerialPortDataListener listener)
-
getInputStream
java.io.InputStream getInputStream()
-
getOutputStream
java.io.OutputStream getOutputStream()
-
setRTS
void setRTS()
-
clearRTS
void clearRTS()
-
setBaudRate
void setBaudRate(int baudrate)
-
getBaudRate
int getBaudRate()
-
setNumDataBits
void setNumDataBits(int bits)
-
getNumDataBits
int getNumDataBits()
-
setNumStopBits
void setNumStopBits(int bits)
-
getNumStopBits
int getNumStopBits()
-
setParity
void setParity(SerialPort.Parity parity)
-
getParity
SerialPort.Parity getParity()
-
setDTR
void setDTR()
-
clearDTR
void clearDTR()
-
getDTR
boolean getDTR()
-
getRTS
boolean getRTS()
-
getDSR
boolean getDSR()
-
getCTS
boolean getCTS()
-
getDCD
boolean getDCD()
-
getRI
boolean getRI()
-
setFlowControl
void setFlowControl(AbstractSerialPortController.FlowControl flow)
Configure the flow control settings. Keep this in synch with the FlowControl enum.- Parameters:
flow
- set which kind of flow control to use
-
setBreak
void setBreak()
-
clearBreak
void clearBreak()
-
getFlowControlSettings
int getFlowControlSettings()
-
setComPortTimeouts
boolean setComPortTimeouts(int newTimeoutMode, int newReadTimeout, int newWriteTimeout)
-
closePort
void closePort()
-
getDescriptivePortName
java.lang.String getDescriptivePortName()
-
toString
java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-