@canboat/canboatjs 2.9.0 → 2.10.0

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/canbus.js CHANGED
@@ -220,6 +220,10 @@ CanbusStream.prototype.sendPGN = function (msg) {
220
220
 
221
221
  debug('sending %j', msg)
222
222
 
223
+ if ( this.options.app ) {
224
+ this.options.app.emit('connectionwrite', { providerId: this.options.providerId })
225
+ }
226
+
223
227
  let src = msg.pgn === 59904 || msg.forceSrc ? msg.src : this.candevice.address
224
228
  if ( _.isString(msg) ) {
225
229
  var split = msg.split(',')
package/lib/ikonvert.js CHANGED
@@ -75,9 +75,11 @@ function iKonvertStream (options) {
75
75
  } else {
76
76
  that.sendPGN(msg)
77
77
  }
78
+ options.app.emit('connectionwrite', { providerId: options.providerId })
78
79
  })
79
80
  options.app.on(options.jsonOutEvent || 'nmea2000JsonOut', (msg) => {
80
81
  that.sendPGN(msg)
82
+ options.app.emit('connectionwrite', { providerId: options.providerId })
81
83
  })
82
84
 
83
85
  this.isSetup = false
package/lib/serial.js CHANGED
@@ -148,6 +148,7 @@ SerialStream.prototype.start = function () {
148
148
  buf = composeMessage(N2K_MSG_SEND, buf, buf.length)
149
149
  debugOut(buf)
150
150
  that.serial.write(buf)
151
+ that.options.app.emit('connectionwrite', { providerId: that.options.providerId })
151
152
  }
152
153
 
153
154
  function writeObject(msg) {
@@ -158,6 +159,7 @@ SerialStream.prototype.start = function () {
158
159
  buf = composeMessage(N2K_MSG_SEND, buf, buf.length)
159
160
  debugOut(buf)
160
161
  that.serial.write(buf)
162
+ that.options.app.emit('connectionwrite', { providerId: that.options.providerId })
161
163
  }
162
164
 
163
165
  this.options.app.on(this.options.outEevent || 'nmea2000out', msg => {
package/lib/w2k01.js CHANGED
@@ -49,10 +49,12 @@ function W2K01Stream (options, type, outEvent) {
49
49
  } else {
50
50
  this.sendPGN(msg)
51
51
  }
52
+ options.app.emit('connectionwrite', { providerId: options.providerId })
52
53
  })
53
54
 
54
55
  options.app.on(options.jsonOutEvent || 'nmea2000JsonOut', (msg) => {
55
56
  this.sendPGN(msg)
57
+ options.app.emit('connectionwrite', { providerId: options.providerId })
56
58
  })
57
59
  }
58
60
  }
package/lib/ydgw02.js CHANGED
@@ -55,10 +55,12 @@ function Ydgw02Stream (options, type) {
55
55
  } else {
56
56
  this.sendPGN(msg)
57
57
  }
58
+ options.app.emit('connectionwrite', { providerId: options.providerId })
58
59
  })
59
60
 
60
61
  options.app.on(options.jsonOutEvent || 'nmea2000JsonOut', (msg) => {
61
62
  this.sendPGN(msg)
63
+ options.app.emit('connectionwrite', { providerId: options.providerId })
62
64
  })
63
65
 
64
66
  //this.sendString('$PDGY,N2NET_OFFLINE')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canboat/canboatjs",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Native javascript version of canboat",
5
5
  "main": "index.js",
6
6
  "scripts": {