Class 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
    The TtyPortMetrics describe a COM or TTY serial Port on your computer.
    • Constructor Detail

      • 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 Detail

      • 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.
      • getReadTimeoutInMs

        public long getReadTimeoutInMs()
        The read timeout in milliseconds.
        Specified by:
        getReadTimeoutInMs in interface org.refcodes.mixin.ReadTimeoutInMsAccessor
        Returns:
        The read timeout.
      • getWriteTimeoutInMs

        public long getWriteTimeoutInMs()
        The write timeout in milliseconds.
        Specified by:
        getWriteTimeoutInMs in interface org.refcodes.mixin.WriteTimeoutInMsAccessor
        Returns:
        The write timeout.