devicestack
Advanced tools
Comparing version 1.10.1 to 1.10.2
@@ -232,3 +232,3 @@ var util = require('util'), | ||
async.forEachSeries(toConnect, function(dc, clb) { | ||
self.connect(dc); | ||
self.connect(dc, clb); | ||
}, function(err) { | ||
@@ -367,6 +367,15 @@ if (err && !err.name) { | ||
device = this.currentState.getDevice(deviceOrId); | ||
} else if (deviceOrId.id) { | ||
} else if (deviceOrId.id && !device.connect) { | ||
device = this.currentState.getDevice(deviceOrId.id); | ||
} else if (!deviceOrId.connect) { | ||
device = null; | ||
} | ||
if (!device) { | ||
var err = new Error('Device not found!'); | ||
if (this.log) { this.log(err.message); } | ||
if (callback) { callback(err); } | ||
return; | ||
} | ||
if (!this.deviceErrorSubscriptions[device.id]) { | ||
@@ -447,9 +456,12 @@ this.deviceErrorSubscriptions[device.id] = function(err) { | ||
device = this.currentState.getConnectedDevice(deviceOrId); | ||
} else if (deviceOrId.id) { | ||
} else if (deviceOrId.id && !deviceOrId.disconnect) { | ||
device = this.currentState.getDevice(deviceOrId.id); | ||
} else if (!deviceOrId.disconnect) { | ||
device = null; | ||
} | ||
if (!device) { | ||
if (this.log) this.log('Device not connected!'); | ||
if (callback) { callback(new Error('Device not connected!')); } | ||
var err = new Error('Device not found!'); | ||
if (this.log) { this.log(err.message); } | ||
if (callback) { callback(err); } | ||
return; | ||
@@ -456,0 +468,0 @@ } |
@@ -58,3 +58,3 @@ var DeviceGuider = require('../deviceguider'), | ||
} | ||
this.connectDevice(device, callback); | ||
this.connect(device, callback); | ||
}; | ||
@@ -77,5 +77,5 @@ | ||
var device = this.currentState.getConnectedDeviceByPort(port); | ||
this.disconnectDevice(device, callback); | ||
this.disconnect(device, callback); | ||
}; | ||
module.exports = SerialDeviceGuider; |
{ | ||
"name": "devicestack", | ||
"version": "1.10.1", | ||
"version": "1.10.2", | ||
"description": "This module helps you to represent a device and its protocol.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -1,2 +0,2 @@ | ||
## v1.10.1 | ||
## v1.10.2 | ||
- DeviceGuider: fix callback call for autoconnect | ||
@@ -3,0 +3,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
123393
2571