Skip to content

Commit d597e11

Browse files
committed
Add command logging and update serialport library
1 parent 80c842c commit d597e11

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/Controller.js

+7
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ Controller.prototype._sendCommand = function(command, cb) {
191191
var self = this;
192192

193193
self.port.write(command + '\r\n', function(err) {
194+
if (err) {
195+
self.emit('log', util.format(
196+
'Error sending command "%s": %s',
197+
command,
198+
err.message
199+
));
200+
}
194201
if (typeof cb === 'function') {
195202
cb(err);
196203
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"express" : "^4.13.4",
66
"js-yaml" : "^3.6.1",
77
"moment" : "^2.13.0",
8-
"serialport" : "^3.1.2",
8+
"serialport" : "^4.0.7",
99
"split" : "^1.0.0"
1010
}
1111
}

0 commit comments

Comments
 (0)