@canboat/canboatjs 1.28.1 → 1.28.3

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { Transform } = require('stream');
4
- const SerialPort = require('serialport')
4
+ const { SerialPort } = require('serialport')
5
5
 
6
6
  if ( process.argv.length < 3 ) {
7
7
  console.error('Please specify a device')
@@ -13,7 +13,8 @@ let device = process.argv[2]
13
13
 
14
14
  let baud = process.argv.length > 3 ? Number(process.argv[3]) : 230400
15
15
 
16
- let serial = new SerialPort(device, {
16
+ let serial = new SerialPort({
17
+ path:device,
17
18
  baudRate: baud
18
19
  })
19
20
 
package/lib/canbus.js CHANGED
@@ -94,6 +94,9 @@ function CanbusStream (options) {
94
94
  this.socketCanWriter = null
95
95
  var hasWriter = spawn('sh', ['-c', 'which socketcan-writer'])
96
96
 
97
+ const setProviderError = this.setProviderError.bind(this)
98
+ const setProviderStatus = this.setProviderStatus.bind(this)
99
+
97
100
  hasWriter.on('close', code => {
98
101
  if ( code == 0 ) {
99
102
  debug('found socketcan-writer, starting...')
package/lib/serial.js CHANGED
@@ -17,7 +17,7 @@
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')
20
+ const { SerialPort } = require('serialport')
21
21
  const isArray = require('lodash').isArray
22
22
  const BitStream = require('bit-buffer').BitStream
23
23
  const BitView = require('bit-buffer').BitView
@@ -113,7 +113,8 @@ SerialStream.prototype.start = function () {
113
113
  }
114
114
 
115
115
  if ( !this.options.fromFile ) {
116
- this.serial = new SerialPort(this.options.device, {
116
+ this.serial = new SerialPort({
117
+ path: this.options.device,
117
118
  baudRate: this.options.baudrate || 115200
118
119
  })
119
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canboat/canboatjs",
3
- "version": "1.28.1",
3
+ "version": "1.28.3",
4
4
  "description": "Native javascript version of canboat",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -79,7 +79,7 @@
79
79
  "webpack-cli": "^3.3.10"
80
80
  },
81
81
  "optionalDependencies": {
82
- "serialport": "^9.0.7",
82
+ "serialport": "^11.0.1",
83
83
  "socketcan": "^4.0.3"
84
84
  },
85
85
  "repository": {