Methods
deviceNames(callback)
Get serial port device names
Parameters:
Name | Type | Description |
---|---|---|
callback |
stringArrayCallback |
devicePaths(callback)
Get serial port device paths
Parameters:
Name | Type | Description |
---|---|---|
callback |
stringArrayCallback |
devicePathsAsync() → {Promise.<Array.<string>>}
Get serial port device paths
Returns:
paths
- Type
- Promise.<Array.<string>>
getSuPath(callback)
get su binary path
Parameters:
Name | Type | Description |
---|---|---|
callback |
stringCallback |
open(devicePath, options) → {Promise.<SerialPort>}
Open serial port
Parameters:
Name | Type | Description |
---|---|---|
devicePath |
string | device path |
options |
openOptions |
Returns:
connected serial port
- Type
- Promise.<SerialPort>
setSuPath(suPath)
set su binary path
Parameters:
Name | Type | Description |
---|---|---|
suPath |
string |
Type Definitions
listener(buffer)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
buffer |
Buffer | data Buffer |
openOptions
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)
Parameters:
Name | Type | Description |
---|---|---|
values |
Array.<string> |
stringCallback(value)
Parameters:
Name | Type | Description |
---|---|---|
value |
string |