Constructor
new ReadyParser(options)
To use the Ready
parser provide a byte start sequence. After the bytes have been received a ready event is fired and data events are passed through.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object | options for the parser Properties
|
- Source:
Example
const SerialPort = require('serialport')
const Ready = require('@serialport/parser-ready')
const port = new SerialPort('/dev/tty-usbserial1')
const parser = port.pipe(new Ready({ delimiter: 'READY' }))
parser.on('ready', () => console.log('the ready byte sequence has been received'))
parser.on('data', console.log) // all data after READY is received
Extends
- Transform