@canboat/canboatjs 1.28.3 → 1.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/serial.js +5 -3
- package/package.json +1 -1
package/lib/serial.js
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
const debug = require('debug')('signalk:actisense-serial')
|
|
18
18
|
const debugOut = require('debug')('signalk:actisense-out')
|
|
19
19
|
const Transform = require('stream').Transform
|
|
20
|
-
const { SerialPort } = require('serialport')
|
|
21
20
|
const isArray = require('lodash').isArray
|
|
22
21
|
const BitStream = require('bit-buffer').BitStream
|
|
23
22
|
const BitView = require('bit-buffer').BitView
|
|
@@ -113,6 +112,7 @@ SerialStream.prototype.start = function () {
|
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
if ( !this.options.fromFile ) {
|
|
115
|
+
const { SerialPort } = require('serialport')
|
|
116
116
|
this.serial = new SerialPort({
|
|
117
117
|
path: this.options.device,
|
|
118
118
|
baudRate: this.options.baudrate || 115200
|
|
@@ -398,7 +398,9 @@ function processNTGMessage(that, buffer, len)
|
|
|
398
398
|
if ( !that.outAvailable ) {
|
|
399
399
|
if ( command === 0x11 ) {
|
|
400
400
|
that.gotTXPGNList = false
|
|
401
|
-
|
|
401
|
+
setTimeout(() => {
|
|
402
|
+
requestTransmitPGNList(that)
|
|
403
|
+
}, 2000)
|
|
402
404
|
} else if ( command === 0x49 && buffer[3] === 1 ) {
|
|
403
405
|
that.gotTXPGNList = true
|
|
404
406
|
const pgnCount = buffer[14];
|
|
@@ -431,7 +433,7 @@ function processNTGMessage(that, buffer, len)
|
|
|
431
433
|
if ( that.neededTransmitPGNs.length === 0 ) {
|
|
432
434
|
const commitMsg = composeCommitTXPGN()
|
|
433
435
|
debugOut(commitMsg)
|
|
434
|
-
that.serial.write(
|
|
436
|
+
that.serial.write(commitMsg)
|
|
435
437
|
} else {
|
|
436
438
|
enableTXPGN(that.serial, that.neededTransmitPGNs[0])
|
|
437
439
|
}
|