Reassembles whole SLIP frames from the chunks a serial port delivers.
const decoder = new SlipDecoder()port.on('data', (chunk) => { for (const frame of decoder.feed(chunk)) handle(frame)}) Copy
const decoder = new SlipDecoder()port.on('data', (chunk) => { for (const frame of decoder.feed(chunk)) handle(frame)})
Creates an empty decoder, ready for the first chunk.
How many corrupt frames this decoder has discarded.
Feeds a chunk of the stream.
The bytes just read from the port.
Every frame this chunk completed, in order, which is often none.
Discards any partly assembled frame.
Reassembles whole SLIP frames from the chunks a serial port delivers.
Example