- java.lang.Object
-
- org.refcodes.serial.alt.tty.TtyPortMetrics
-
- All Implemented Interfaces:
org.refcodes.mixin.ReadTimeoutInMsAccessor
,org.refcodes.mixin.WriteTimeoutInMsAccessor
,org.refcodes.serial.PortMetrics
- Direct Known Subclasses:
TtyPortMetricsBuilder
public class TtyPortMetrics extends Object implements org.refcodes.serial.PortMetrics, org.refcodes.mixin.ReadTimeoutInMsAccessor, org.refcodes.mixin.WriteTimeoutInMsAccessor
TheTtyPortMetrics
describe a COM or TTY serialPort
on your computer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.ReadTimeoutInMsAccessor
org.refcodes.mixin.ReadTimeoutInMsAccessor.ReadTimeoutInMsBuilder<B extends org.refcodes.mixin.ReadTimeoutInMsAccessor.ReadTimeoutInMsBuilder<B>>, org.refcodes.mixin.ReadTimeoutInMsAccessor.ReadTimeoutInMsMutator, org.refcodes.mixin.ReadTimeoutInMsAccessor.ReadTimeoutInMsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.WriteTimeoutInMsAccessor
org.refcodes.mixin.WriteTimeoutInMsAccessor.WriteTimeoutInMsBuilder<B extends org.refcodes.mixin.WriteTimeoutInMsAccessor.WriteTimeoutInMsBuilder<B>>, org.refcodes.mixin.WriteTimeoutInMsAccessor.WriteTimeoutInMsMutator, org.refcodes.mixin.WriteTimeoutInMsAccessor.WriteTimeoutInMsProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected int
_baudRate
protected int
_dataBits
protected Handshake
_handshake
protected Parity
_parity
protected long
_readTimeoutInMs
protected StopBits
_stopBits
protected long
_writeTimeoutInMs
static int
DEFAULT_DATA_BITS
Default number of data bits to use.
-
Constructor Summary
Constructors Constructor Description TtyPortMetrics()
Constructs thePortMetrics
instance.TtyPortMetrics(int aBaudRate)
Constructs thePortMetrics
instance.TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
Constructs thePortMetrics
instance.TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
Constructs thePortMetrics
instance.TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
Constructs thePortMetrics
instance.TtyPortMetrics(BaudRate aBaudRate)
Constructs thePortMetrics
instance.TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
Constructs thePortMetrics
instance.TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
Constructs thePortMetrics
instance.TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
Constructs thePortMetrics
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBaudRate()
The baud rate of the port.int
getDataBits()
The number of data bits used by the port.Handshake
getHandshake()
The kind ofHandshake
used by the port.Parity
getParity()
TheParity
of the port.long
getReadTimeoutInMs()
The read timeout in milliseconds.StopBits
getStopBits()
The number of stop bits used by the port.long
getWriteTimeoutInMs()
The write timeout in milliseconds.String
toString()
-
-
-
Field Detail
-
DEFAULT_DATA_BITS
public static final int DEFAULT_DATA_BITS
Default number of data bits to use. As we work with bytes all over here, we use 8 data bits by default!- See Also:
- Constant Field Values
-
_baudRate
protected int _baudRate
-
_parity
protected Parity _parity
-
_dataBits
protected int _dataBits
-
_stopBits
protected StopBits _stopBits
-
_handshake
protected Handshake _handshake
-
_readTimeoutInMs
protected long _readTimeoutInMs
-
_writeTimeoutInMs
protected long _writeTimeoutInMs
-
-
Constructor Detail
-
TtyPortMetrics
public TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
Constructs thePortMetrics
instance.
-
TtyPortMetrics
public TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
Constructs thePortMetrics
instance.
-
TtyPortMetrics
public TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
Constructs thePortMetrics
instance. Timeouts are disabled.
-
TtyPortMetrics
public TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
Constructs thePortMetrics
instance. Timeouts are disabled.
-
TtyPortMetrics
public TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
Constructs thePortMetrics
instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO
).
-
TtyPortMetrics
public TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
Constructs thePortMetrics
instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO
).
-
TtyPortMetrics
public TtyPortMetrics(int aBaudRate)
Constructs thePortMetrics
instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking, stop bits and parity are used (Handshake.AUTO
).- Parameters:
aBaudRate
- The baud rate to be set.
-
TtyPortMetrics
public TtyPortMetrics(BaudRate aBaudRate)
Constructs thePortMetrics
instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking, stop bits and parity are used (Handshake.AUTO
).- Parameters:
aBaudRate
- TheBaudRate
to be set.
-
TtyPortMetrics
public TtyPortMetrics()
Constructs thePortMetrics
instance. Timeouts are disabled. The underlying system's implementation or other implementation specific baud rate, handshaking, stop bits and parity are used (Handshake.AUTO
).
-
-
Method Detail
-
getBaudRate
public int getBaudRate()
The baud rate of the port.- Returns:
- The port's baud rate.
-
getDataBits
public int getDataBits()
The number of data bits used by the port.- Returns:
- The data bits used by the port.
-
getStopBits
public StopBits getStopBits()
The number of stop bits used by the port.- Returns:
- The stop bits used by the port.
-
getHandshake
public Handshake getHandshake()
The kind ofHandshake
used by the port.- Returns:
- The port's handshake being used.
-
getReadTimeoutInMs
public long getReadTimeoutInMs()
The read timeout in milliseconds.- Specified by:
getReadTimeoutInMs
in interfaceorg.refcodes.mixin.ReadTimeoutInMsAccessor
- Returns:
- The read timeout.
-
getWriteTimeoutInMs
public long getWriteTimeoutInMs()
The write timeout in milliseconds.- Specified by:
getWriteTimeoutInMs
in interfaceorg.refcodes.mixin.WriteTimeoutInMsAccessor
- Returns:
- The write timeout.
-
-