diff --git a/.generators/README.md b/.generators/README.md index 8ede4bf..90f9f97 100644 --- a/.generators/README.md +++ b/.generators/README.md @@ -2,7 +2,7 @@ This is a node SerialPort project! This package does some neat stuff. -- [Guides and API Docs](https://node-serialport.github.io/node-serialport) +- [Guides and API Docs](https://serialport.io/) This is why you'd use it. diff --git a/README.md b/README.md index 19d45aa..7deba7b 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,13 @@ [![Build status](https://ci.appveyor.com/api/projects/status/u6xe3iao2crd7akn/branch/master?svg=true)](https://ci.appveyor.com/project/serialport/node-serialport/branch/master) [![Greenkeeper badge](https://badges.greenkeeper.io/node-serialport/node-serialport.svg)](https://greenkeeper.io/) -Working with serialports can be hard, this is a collection of projects that make it easier. We currently have the following packages. +Working with serialports can be hard, this is a collection of projects that make it easier. -- [`serialport`](/packages/serialport) [![npm](https://img.shields.io/npm/dm/serialport.svg?maxAge=2592000)](http://npmjs.com/package/serialport) the only package you need to get started. +Goto https://serialport.io/ to learn more. + +We currently have the following packages. + +- `serialport` [![npm](https://img.shields.io/npm/dm/serialport.svg?maxAge=2592000)](http://npmjs.com/package/serialport) the only package you need to get started. - `@serialport/stream` our traditional stream interface with nothing else - `@serialport/binding-abstract` as an abstract class for all bindings - `@serialport/binding-mock` for a mock binding package @@ -20,7 +24,7 @@ Working with serialports can be hard, this is a collection of projects that make - Parser slip-encoder ## Quick Answers to Important Questions -- [**API Docs**](https://node-serialport.github.io/node-serialport/) +- [**API Docs**](https://serialport.io/docs/api-overview) ## Intro to Node-Serialport @@ -32,7 +36,8 @@ For a full breakdown of why we made Node-Serialport, please read [NodeBots - The ## API Documentation -- [**API Docs**](https://node-serialport.github.io/node-serialport/) +- [**API Docs**](https://serialport.io/docs/api-overview) + You can generate the docs by running diff --git a/docs/api-parser-slip-encoder.md b/docs/api-parser-slip-encoder.md index 3048565..2c93866 100644 --- a/docs/api-parser-slip-encoder.md +++ b/docs/api-parser-slip-encoder.md @@ -2,23 +2,26 @@ id: api-parser-slip-encoder title: Slip Encoder Parser --- +```typescript +new SlipEncoder(options) +``` A transform stream that emits SLIP-encoded data for each incoming packet. Unlike most parsers this one is useful for processing input to the serialport instead of output. -Runs in O(n) time, adding a 0xC0 character at the end of each received packet and escaping characters, according to RFC 1055. Adds another -0xC0 character at the beginning if the `bluetoothQuirk` option is truthy (as -per the Bluetooth Core Specification 4.0, Volume 4, Part D, Chapter 3 "SLIP Layer"). -Runs in O(n) time. +Runs in O(n) time, adding a 0xC0 character at the end of each received packet and escaping characters, according to RFC 1055. Runs in O(n) time. +Arguments: +- `options.bluetoothQuirk: boolean` Adds another 0xC0 character at the beginning if the `bluetoothQuirk` option is truthy (as per the Bluetooth Core Specification 4.0, Volume 4, Part D, Chapter 3 "SLIP Layer") ```js // Read lines from a text file, then SLIP-encode each and send them to a serial port const SerialPort = require('serialport') const SlipEncoder = require('@serialport/parser-slip-encoder') const Readline = require('parser-readline') -const fileReader = require('fs').createReadStream('/tmp/some-file.txt'); +const fileReader = require('fs').createReadStream('/tmp/some-file.txt') + const port = new SerialPort('/dev/tty-usbserial1') -const lineParser = fileReader.pipe(new Readline({ delimiter: '\r\n' })); -const encoder = fileReader.pipe(new SlipEncoder({ bluetoothQuirk: false })); -encoder.pipe(port); +const lineParser = fileReader.pipe(new Readline({ delimiter: '\r\n' })) +const encoder = fileReader.pipe(new SlipEncoder({ bluetoothQuirk: false })) +encoder.pipe(port) ``` diff --git a/packages/parser-byte-length/README.md b/packages/parser-byte-length/README.md index 60bd35f..3a83f47 100644 --- a/packages/parser-byte-length/README.md +++ b/packages/parser-byte-length/README.md @@ -1 +1 @@ -See our api docs https://node-serialport.github.io/node-serialport/ByteLengthParser.html +See our api docs https://serialport.io/docs/api-parser-byte-length diff --git a/packages/parser-delimiter/README.md b/packages/parser-delimiter/README.md index 622f852..b60cf12 100644 --- a/packages/parser-delimiter/README.md +++ b/packages/parser-delimiter/README.md @@ -1 +1 @@ -See our api docs https://node-serialport.github.io/node-serialport/DelimiterParser.html +See our api docs https://serialport.io/docs/api-parser-delimiter diff --git a/packages/parser-readline/README.md b/packages/parser-readline/README.md index 0c05722..6c9669c 100644 --- a/packages/parser-readline/README.md +++ b/packages/parser-readline/README.md @@ -1 +1 @@ -See our api docs https://node-serialport.github.io/node-serialport/ReadLineParser.html +See our api docs See our api docs https://serialport.io/docs/api-parser-readline diff --git a/packages/parser-ready/README.md b/packages/parser-ready/README.md index 9d356d0..a868a08 100644 --- a/packages/parser-ready/README.md +++ b/packages/parser-ready/README.md @@ -1 +1 @@ -See our api docs https://node-serialport.github.io/node-serialport/ReadyParser.html +See our api docs https://serialport.io/docs/api-parser-ready diff --git a/packages/parser-regex/README.md b/packages/parser-regex/README.md index e7287ec..bba891c 100644 --- a/packages/parser-regex/README.md +++ b/packages/parser-regex/README.md @@ -1 +1 @@ -See our api docs https://node-serialport.github.io/node-serialport/RegexParser.html +See our api docs https://serialport.io/docs/api-parser-regex diff --git a/packages/parser-slip-encoder/README.md b/packages/parser-slip-encoder/README.md index e74f588..64c1846 100644 --- a/packages/parser-slip-encoder/README.md +++ b/packages/parser-slip-encoder/README.md @@ -1 +1 @@ -See our api docs https://node-serialport.github.io/node-serialport/SlipEncoderParser.html +See our api docs https://serialport.io/docs/api-parser-slip-encoder