Serial

Serial

new Serial(opts, adapter)

Source:

A transport for data that involves reading and writing to a serial port

Parameters:
Name Type Description
opts Object

General settings for the Serial Transport

Properties
Name Type Attributes Description
port Object/String

The serial device to open

Properties
Name Type Attributes Description
product String <optional>

The serial device's product id

vendor String <optional>

The serial device's vendor id

baudRate Number
dataBits Number
stopBits Number
parity String
parser Object <optional>

Optional serial parser

adapter Adapter

Adapter for which this is a plugin

Extends

Methods

close()

Source:

Close the listener

(private) getSerial() → {Promise}

Source:

Get the correct path for the serial port

Returns:
Type
Promise

(private) init() → {Promise}

Source:

init Configure, open, and setup the serial port

Returns:
Type
Promise

(private) received(data)

Source:

Process incoming data

Parameters:
Name Type Description
data Buffer

The data buffer

send(address, command)

Source:
Overrides:

Send a command to the serial port

Parameters:
Name Type Description
address Object

Not used by serial

command Command

The command to send

(private) write(data) → {Promise}

Source:

Write data to the serial port

Parameters:
Name Type Description
data Buffer | Array.<Buffer>

The data buffer or the Array of data buffers for a multipart message

Returns:

Resolves after the data in the first Buffer has been written to the serial port

Type
Promise