serial
Provides methods for working with serial ports.
getBuffer
Return data buffer.
Returns:
CircularStringBuffer
- Data buffer.
list
Returns list of available ports.
See https://github.com/EmergingTechnologyAdvisors/node-serialport#module_serialport--SerialPort.list for details about the structure of returned values.
Returns:
Array.<Object>
- Array of port descriptions.
open
Opens a serial port.
Data from the opened port will be automatically read line by line into a circular buffer. Once the buffer reaches it's maximum capacity specified by bufferSize
argument, eldest entries are evicted to make room for new data.
** Serial port properties with default values:**
Parameters:
Name | Type | Description |
---|---|---|
|
| Path to serial port. E.g. '/dev/tty-usbserial1', 'COM5', etc. |
|
| Port properties. |
|
|
|
Returns:
SerialPort
- SerialPort object.
waitForText
Waits for text to appear in the input data buffer.
Text pattern can be any of the supported string matching patterns(on the top of page).
Parameters:
Name | Type | Description |
---|---|---|
|
| Text pattern. |
|
|
|
write
Write data to the port.
** Usage example:**
Parameters:
Name | Type | Description |
---|---|---|
|
| Data to send. Either a string or an array of bytes. |
Last updated