Module com.pi4j

Interface Serial

    • Field Detail

      • DEFAULT_DATA_BITS

        static final DataBits DEFAULT_DATA_BITS
        Constant DEFAULT_DATA_BITS
      • DEFAULT_PARITY

        static final Parity DEFAULT_PARITY
        Constant DEFAULT_PARITY
      • DEFAULT_STOP_BITS

        static final StopBits DEFAULT_STOP_BITS
        Constant DEFAULT_STOP_BITS
      • DEFAULT_FLOW_CONTROL

        static final FlowControl DEFAULT_FLOW_CONTROL
        Constant DEFAULT_FLOW_CONTROL
    • Method Detail

      • isOpen

        boolean isOpen()
        Serial Device Communication State is OPEN
        Returns:
        The Serial device communication state
      • available

        int available()
        Get the number of data bytes available in the serial receive buffer
        Returns:
        a int.
      • drain

        default int drain()
        This function will drain the current serial receive buffer of any lingering bytes.
        Returns:
        Returns the number of bytes of data drained (>=0) if OK, otherwise a negative error code.
      • open

        void open()

        open.