Class TtyPortMetrics

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
    Modifier and Type
    Class
    Description
    static final class 
    Builder to build TtyPortMetrics.

    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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs the PortMetrics instance.
    TtyPortMetrics(int aBaudRate)
    Constructs the PortMetrics instance.
    TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
    Constructs the PortMetrics instance.
    TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
    Constructs the PortMetrics instance.
    TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
    Constructs the PortMetrics instance.
    Constructs the PortMetrics instance.
    TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
    Constructs the PortMetrics instance.
    TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
    Constructs the PortMetrics instance.
    TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
    Constructs the PortMetrics instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates builder to build TtyPortMetrics.
    int
    The baud rate of the port.
    int
    The number of data bits used by the port.
    The kind of Handshake used by the port.
    The Parity of the port.
    long
    The read timeout in milliseconds.
    The number of stop bits used by the port.
    long
    The write timeout in milliseconds.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • TtyPortMetrics

      public TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
      Constructs the PortMetrics instance.
      Parameters:
      aBaudRate - The baud rate to be set.
      aDataBits - The data bits to be set.
      aStopBits - The StopBits to be set.
      aParity - The Parity be set.
      aHandshake - The Handshake be set.
      aReadTimeoutInMs - The read timeout to be set.
      aWriteTimeoutInMs - The write timeout to be set.
    • TtyPortMetrics

      public TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake, long aReadTimeoutInMs, long aWriteTimeoutInMs)
      Constructs the PortMetrics instance.
      Parameters:
      aBaudRate - The BaudRate to be set.
      aDataBits - The data bits to be set.
      aStopBits - The StopBits to be set.
      aParity - The Parity be set.
      aHandshake - The Handshake be set.
      aReadTimeoutInMs - The read timeout to be set.
      aWriteTimeoutInMs - The write timeout to be set.
    • TtyPortMetrics

      public TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
      Constructs the PortMetrics instance. Timeouts are disabled.
      Parameters:
      aBaudRate - The baud rate to be set.
      aDataBits - The data bits to be set.
      aStopBits - The StopBits to be set.
      aParity - The Parity be set.
      aHandshake - The Handshake be set.
    • TtyPortMetrics

      public TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity, Handshake aHandshake)
      Constructs the PortMetrics instance. Timeouts are disabled.
      Parameters:
      aBaudRate - The BaudRate to be set.
      aDataBits - The data bits to be set.
      aStopBits - The StopBits to be set.
      aParity - The Parity be set.
      aHandshake - The Handshake be set.
    • TtyPortMetrics

      public TtyPortMetrics(int aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
      Constructs the PortMetrics instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO).
      Parameters:
      aBaudRate - The baud rate to be set.
      aDataBits - The data bits to be set.
      aStopBits - The StopBits to be set.
      aParity - The Parity be set.
    • TtyPortMetrics

      public TtyPortMetrics(BaudRate aBaudRate, int aDataBits, StopBits aStopBits, Parity aParity)
      Constructs the PortMetrics instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO).
      Parameters:
      aBaudRate - The BaudRate to be set.
      aDataBits - The data bits to be set.
      aStopBits - The StopBits to be set.
      aParity - The Parity be set.
    • TtyPortMetrics

      public TtyPortMetrics(int aBaudRate)
      Constructs the PortMetrics 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 the PortMetrics 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 BaudRate to be set.
    • TtyPortMetrics

      public TtyPortMetrics()
      Constructs the PortMetrics 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

      public Parity getParity()
      The Parity 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

      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 of Handshake used by the port.
      Returns:
      The port's handshake being used.
    • getReadTimeoutMillis

      public long getReadTimeoutMillis()
      The read timeout in milliseconds.
      Specified by:
      getReadTimeoutMillis in interface org.refcodes.mixin.ReadTimeoutMillisAccessor
      Returns:
      The read timeout.
    • getWriteTimeoutMillis

      public long getWriteTimeoutMillis()
      The write timeout in milliseconds.
      Specified by:
      getWriteTimeoutMillis in interface org.refcodes.mixin.WriteTimeoutMillisAccessor
      Returns:
      The write timeout.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static TtyPortMetrics.Builder builder()
      Creates builder to build TtyPortMetrics.
      Returns:
      created builder