@serialport/parser-cctalk
Advanced tools
Comparing version 3.0.0 to 8.0.1
@@ -15,8 +15,19 @@ const { Transform } = require('stream') | ||
class CCTalkParser extends Transform { | ||
constructor() { | ||
constructor(maxDelayBetweenBytesMs = 50) { | ||
super() | ||
this.array = [] | ||
this.cursor = 0 | ||
this.lastByteFetchTime = 0 | ||
this.maxDelayBetweenBytesMs = maxDelayBetweenBytesMs | ||
} | ||
_transform(buffer, _, cb) { | ||
if (this.maxDelayBetweenBytesMs > 0) { | ||
const now = Date.now() | ||
if (now - this.lastByteFetchTime > this.maxDelayBetweenBytesMs) { | ||
this.array = [] | ||
this.cursor = 0 | ||
} | ||
this.lastByteFetchTime = now | ||
} | ||
this.cursor += buffer.length | ||
@@ -23,0 +34,0 @@ // TODO: Better Faster es7 no supported by node 4 |
@@ -6,3 +6,3 @@ # Change Log | ||
# [3.0.0](https://github.com/node-serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.2...@serialport/parser-cctalk@3.0.0) (2019-05-16) | ||
## [8.0.1](https://github.com/serialport/node-serialport/compare/v6.2.2...v8.0.1) (2019-09-18) | ||
@@ -12,5 +12,10 @@ | ||
* remove node6 support and upgrade codebase ([#1851](https://github.com/node-serialport/node-serialport/issues/1851)) ([d4f15c0](https://github.com/node-serialport/node-serialport/commit/d4f15c0)) | ||
* remove node6 support and upgrade codebase ([#1851](https://github.com/serialport/node-serialport/issues/1851)) ([d4f15c0](https://github.com/serialport/node-serialport/commit/d4f15c0)) | ||
### Features | ||
* Added packet timeout for cctalk parser ([#1887](https://github.com/serialport/node-serialport/issues/1887)) ([714e438](https://github.com/serialport/node-serialport/commit/714e438)) | ||
### BREAKING CHANGES | ||
@@ -24,4 +29,27 @@ | ||
## [2.0.2](https://github.com/node-serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.1...@serialport/parser-cctalk@2.0.2) (2018-11-27) | ||
# [4.0.0](https://github.com/serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.2...@serialport/parser-cctalk@4.0.0) (2019-08-05) | ||
### implementing packet byte timeouts due to cctalk documentation | ||
* Added timeout parameter to constructor | ||
* Implemented the reset of packet receiving process after timeout ([#1886]) | ||
# [3.0.0](https://github.com/serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.2...@serialport/parser-cctalk@3.0.0) (2019-05-16) | ||
### chore | ||
* remove node6 support and upgrade codebase ([#1851](https://github.com/serialport/node-serialport/issues/1851)) ([d4f15c0](https://github.com/serialport/node-serialport/commit/d4f15c0)) | ||
### BREAKING CHANGES | ||
* bindings now use async functions so they’ll never throw, only reject | ||
## [2.0.2](https://github.com/serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.1...@serialport/parser-cctalk@2.0.2) (2018-11-27) | ||
**Note:** Version bump only for package @serialport/parser-cctalk | ||
@@ -34,3 +62,3 @@ | ||
<a name="2.0.1"></a> | ||
## [2.0.1](https://github.com/node-serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.0...@serialport/parser-cctalk@2.0.1) (2018-08-29) | ||
## [2.0.1](https://github.com/serialport/node-serialport/compare/@serialport/parser-cctalk@2.0.0...@serialport/parser-cctalk@2.0.1) (2018-08-29) | ||
@@ -37,0 +65,0 @@ **Note:** Version bump only for package @serialport/parser-cctalk |
{ | ||
"name": "@serialport/parser-cctalk", | ||
"version": "3.0.0", | ||
"version": "8.0.1", | ||
"main": "cctalk.js", | ||
@@ -14,5 +14,5 @@ "engines": { | ||
"type": "git", | ||
"url": "git://github.com/node-serialport/node-serialport.git" | ||
"url": "git://github.com/serialport/node-serialport.git" | ||
}, | ||
"gitHead": "524a2729003a94c9575904448d878a151f4f3790" | ||
"gitHead": "eae28d4a00df1cc44e054acd34b530377cdc62c6" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5268
48