Methods

  • Clears the read buffer

    Returns Promise<void>

  • Disconnects and closes the connection

    Returns Promise<void>

  • Returns an array of strings of all readings in the buffer. The buffer starts to be populated when the connection is opened. The read buffer is reset each time readAll() or clearBuffer() is called.

    Returns Promise<string[]>

  • Returns the next reading received by the serial connection.

    Parameters

    • OptionalpreReadCommand: string

      Command to send to the connection before taking a reading

    • OptionalpostReadCommand: string

      Command to send to the connection after taking a reading

    Returns Promise<string>

  • Writes a command to the connection

    Parameters

    • command: string

    Returns Promise<void>