devicestack
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -47,7 +47,2 @@ var util = require('util'), | ||
}, | ||
getDeviceByPort: function(port) { | ||
return _.find(self.currentState.plugged, function(d) { | ||
return d.get('portName') === port; | ||
}); | ||
}, | ||
getConnectedDevice: function(id) { | ||
@@ -58,7 +53,2 @@ return _.find(self.currentState.connected, function(dc) { | ||
}, | ||
getConnectedDeviceByPort: function(id) { | ||
return _.find(self.currentState.connected, function(dc) { | ||
return dc.get('portName') === port; | ||
}); | ||
}, | ||
getDeviceByConnection: function(id) { | ||
@@ -65,0 +55,0 @@ return _.find(self.currentState.connected, function(dc) { |
@@ -50,3 +50,3 @@ var EventEmitter2 = require('eventemitter2').EventEmitter2, | ||
_.each(remDevs, function(d) { | ||
if (self.log) self.log('unplug device with id ' + device.id); | ||
if (self.log) self.log('unplug device with id ' + d.id); | ||
if (d.close) { | ||
@@ -60,3 +60,3 @@ d.close(); | ||
_.each(addDevs, function(d) { | ||
if (self.log) self.log('plug device with id ' + device.id); | ||
if (self.log) self.log('plug device with id ' + d.id); | ||
self.emit('plug', d); | ||
@@ -63,0 +63,0 @@ }); |
@@ -48,3 +48,6 @@ var ftdi = require("ftdi"), | ||
} | ||
self.emit('error', err); | ||
if (self.listeners('error').length) { | ||
self.emit('error', err); | ||
} | ||
}); | ||
@@ -51,0 +54,0 @@ |
@@ -41,3 +41,6 @@ var sp = require("serialport"), | ||
} | ||
self.emit('error', err); | ||
if (self.listeners('error').length) { | ||
self.emit('error', err); | ||
} | ||
}); | ||
@@ -44,0 +47,0 @@ |
@@ -19,3 +19,3 @@ var DeviceGuider = require('../deviceguider'), | ||
return _.find(self.currentState.plugged, function(d) { | ||
return d.get('portName') === port; | ||
return d.get('portName') && port && d.get('portName').toLowerCase() === port.toLowerCase(); | ||
}); | ||
@@ -25,4 +25,4 @@ }; | ||
this.currentState.getConnectedDeviceByPort = function(port) { | ||
return _.find(self.currentState.connected, function(dc) { | ||
return dc.get('portName') === port; | ||
return _.find(self.currentState.connected, function(d) { | ||
return d.get('portName') && port && d.get('portName').toLowerCase() === port.toLowerCase(); | ||
}); | ||
@@ -29,0 +29,0 @@ }; |
@@ -65,3 +65,3 @@ var sp = require('serialport'), | ||
var found = _.find(self.oldDevices, function(dev) { | ||
return dev.get('portName') === p.comName; | ||
return dev.get('portName') && p.comName && dev.get('portName').toLowerCase() === p.comName.toLowerCase(); | ||
}); | ||
@@ -68,0 +68,0 @@ |
@@ -128,3 +128,3 @@ var sp = require('serialport'), | ||
var found = _.find(s.oldDevices, function(dev) { | ||
return dev.get('portName') === p.comName; | ||
return dev.get('portName') && p.comName && dev.get('portName').toLowerCase() === p.comName.toLowerCase(); | ||
}); | ||
@@ -131,0 +131,0 @@ if (found) { |
{ | ||
"name": "devicestack", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "This module helps you to represent a device and its protocol.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -837,2 +837,7 @@ <pre> | ||
## v1.6.1 | ||
- SerialDeviceLoader compare devices by lowercase port name | ||
- emit error on device only if there are listeners | ||
## v1.6.0 | ||
@@ -839,0 +844,0 @@ |
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
100114
888
2056