- java.lang.Object
-
- org.refcodes.serial.alt.tty.TtyPortMetrics
-
- All Implemented Interfaces:
org.refcodes.mixin.ReadTimeoutInMsAccessor
,org.refcodes.mixin.WriteTimeoutInMsAccessor
,org.refcodes.serial.PortMetrics
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 Modifier and Type Class Description static class
TtyPortMetrics.Builder
Builder to buildTtyPortMetrics
.-
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 static int
DEFAULT_DATA_BITS
-
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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TtyPortMetrics.Builder
builder()
Creates builder to buildTtyPortMetrics
.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
- See Also:
- Constant Field Values
-
-
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.
-
builder
public static TtyPortMetrics.Builder builder()
Creates builder to buildTtyPortMetrics
.- Returns:
- created builder
-
-