Global

Methods

deviceNames(callback)

Source:
Get serial port device names
Parameters:
Name Type Description
callback stringArrayCallback

devicePaths(callback)

Source:
Get serial port device paths
Parameters:
Name Type Description
callback stringArrayCallback

devicePathsAsync() → {Promise.<Array.<string>>}

Source:
Get serial port device paths
Returns:
paths
Type
Promise.<Array.<string>>

getSuPath(callback)

Source:
get su binary path
Parameters:
Name Type Description
callback stringCallback

open(devicePath, options) → {Promise.<SerialPort>}

Source:
Open serial port
Parameters:
Name Type Description
devicePath string device path
options openOptions
Returns:
connected serial port
Type
Promise.<SerialPort>

setSuPath(suPath)

Source:
set su binary path
Parameters:
Name Type Description
suPath string

Type Definitions

listener(buffer)

Source:
Parameters:
Name Type Description
buffer Buffer data Buffer

openOptions

Source:
Properties:
Name Type Attributes Default Description
baudRate number such as 9600
parity number <optional>
0 0: none, 1: odd, 2: even
dataBits number <optional>
8 5~8
stopBits number <optional>
1 1 or 2
Type:
  • Object

stringArrayCallback(values)

Source:
Parameters:
Name Type Description
values Array.<string>

stringCallback(value)

Source:
Parameters:
Name Type Description
value string