mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-25 18:37:19 +00:00
docs: Fix missing new thanks to @patrykkalinowski
This commit is contained in:
parent
c90ffbbb28
commit
92c7dd4bfd
2 changed files with 6 additions and 6 deletions
|
|
@ -758,7 +758,7 @@ To use the `Readline` parser, provide a delimiter (defaults to '\n'). Data is em
|
|||
const SerialPort = require('serialport');
|
||||
const Readline = SerialPort.parsers.Readline;
|
||||
const port = new SerialPort('/dev/tty-usbserial1');
|
||||
const parser = port.pipe(Readline({ delimiter: '\r\n' }));
|
||||
const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
|
||||
parser.on('data', console.log);
|
||||
```
|
||||
|
||||
|
|
@ -767,7 +767,7 @@ To use the `Ready` parser provide a byte start sequence. After the bytes have be
|
|||
const SerialPort = require('serialport');
|
||||
const Ready = SerialPort.parsers.Ready;
|
||||
const port = new SerialPort('/dev/tty-usbserial1');
|
||||
const parser = port.pipe(Ready({ data: 'READY' }));
|
||||
const parser = port.pipe(new Ready({ data: 'READY' }));
|
||||
parser.on('ready', () => console.log('the ready byte sequence has been received'))
|
||||
parser.on('data', console.log); // all data after READY is received
|
||||
```
|
||||
|
|
@ -777,7 +777,7 @@ To use the `Regex` parser provide a regular expression to split the incoming tex
|
|||
const SerialPort = require('serialport');
|
||||
const Regex = SerialPort.parsers.Regex;
|
||||
const port = new SerialPort('/dev/tty-usbserial1');
|
||||
const parser = port.pipe(Regex({ regex: /[\r\n]+/ }));
|
||||
const parser = port.pipe(new Regex({ regex: /[\r\n]+/ }));
|
||||
parser.on('data', console.log);
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ To use the `Readline` parser, provide a delimiter (defaults to '\n'). Data is em
|
|||
const SerialPort = require('serialport');
|
||||
const Readline = SerialPort.parsers.Readline;
|
||||
const port = new SerialPort('/dev/tty-usbserial1');
|
||||
const parser = port.pipe(Readline({ delimiter: '\r\n' }));
|
||||
const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
|
||||
parser.on('data', console.log);
|
||||
```
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ To use the `Ready` parser provide a byte start sequence. After the bytes have be
|
|||
const SerialPort = require('serialport');
|
||||
const Ready = SerialPort.parsers.Ready;
|
||||
const port = new SerialPort('/dev/tty-usbserial1');
|
||||
const parser = port.pipe(Ready({ data: 'READY' }));
|
||||
const parser = port.pipe(new Ready({ data: 'READY' }));
|
||||
parser.on('ready', () => console.log('the ready byte sequence has been received'))
|
||||
parser.on('data', console.log); // all data after READY is received
|
||||
```
|
||||
|
|
@ -66,7 +66,7 @@ To use the `Regex` parser provide a regular expression to split the incoming tex
|
|||
const SerialPort = require('serialport');
|
||||
const Regex = SerialPort.parsers.Regex;
|
||||
const port = new SerialPort('/dev/tty-usbserial1');
|
||||
const parser = port.pipe(Regex({ regex: /[\r\n]+/ }));
|
||||
const parser = port.pipe(new Regex({ regex: /[\r\n]+/ }));
|
||||
parser.on('data', console.log);
|
||||
```
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue