java.lang.Object
org.refcodes.serial.alt.tty.TtyPortMetrics
- All Implemented Interfaces:
org.refcodes.mixin.ReadTimeoutMillisAccessor
,org.refcodes.mixin.WriteTimeoutMillisAccessor
,org.refcodes.serial.PortMetrics
public class TtyPortMetrics
extends Object
implements org.refcodes.serial.PortMetrics, org.refcodes.mixin.ReadTimeoutMillisAccessor, org.refcodes.mixin.WriteTimeoutMillisAccessor
The
TtyPortMetrics
describe a COM or TTY serial Port
on your
computer.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ReadTimeoutMillisAccessor
org.refcodes.mixin.ReadTimeoutMillisAccessor.ReadTimeoutMillisBuilder<B extends org.refcodes.mixin.ReadTimeoutMillisAccessor.ReadTimeoutMillisBuilder<B>>, org.refcodes.mixin.ReadTimeoutMillisAccessor.ReadTimeoutMillisMutator, org.refcodes.mixin.ReadTimeoutMillisAccessor.ReadTimeoutMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.WriteTimeoutMillisAccessor
org.refcodes.mixin.WriteTimeoutMillisAccessor.WriteTimeoutMillisBuilder<B extends org.refcodes.mixin.WriteTimeoutMillisAccessor.WriteTimeoutMillisBuilder<B>>, org.refcodes.mixin.WriteTimeoutMillisAccessor.WriteTimeoutMillisMutator, org.refcodes.mixin.WriteTimeoutMillisAccessor.WriteTimeoutMillisProperty
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs 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
Modifier and TypeMethodDescriptionstatic TtyPortMetrics.Builder
builder()
Creates builder to buildTtyPortMetrics
.int
The baud rate of the port.int
The number of data bits used by the port.The kind ofHandshake
used by the port.TheParity
of the port.long
The read timeout in milliseconds.The number of stop bits used by the port.long
The write timeout in milliseconds.toString()
-
Field Details
-
DEFAULT_DATA_BITS
public static final int DEFAULT_DATA_BITS- See Also:
-
-
Constructor Details
-
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
Constructs thePortMetrics
instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO
). -
TtyPortMetrics
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
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 Details
-
getBaudRate
public int getBaudRate()The baud rate of the port.- Returns:
- The port's baud rate.
-
getParity
TheParity
of the port.- Returns:
- The port's parity.
-
getDataBits
public int getDataBits()The number of data bits used by the port.- Returns:
- The data bits used by the port.
-
getStopBits
The number of stop bits used by the port.- Returns:
- The stop bits used by the port.
-
getHandshake
The kind ofHandshake
used by the port.- Returns:
- The port's handshake being used.
-
getReadTimeoutMillis
public long getReadTimeoutMillis()The read timeout in milliseconds.- Specified by:
getReadTimeoutMillis
in interfaceorg.refcodes.mixin.ReadTimeoutMillisAccessor
- Returns:
- The read timeout.
-
getWriteTimeoutMillis
public long getWriteTimeoutMillis()The write timeout in milliseconds.- Specified by:
getWriteTimeoutMillis
in interfaceorg.refcodes.mixin.WriteTimeoutMillisAccessor
- Returns:
- The write timeout.
-
toString
-
builder
Creates builder to buildTtyPortMetrics
.- Returns:
- created builder
-