Skip to content

Commit

Permalink
Add command logging and update serialport library
Browse files Browse the repository at this point in the history
  • Loading branch information
nylen committed Oct 12, 2017
1 parent 80c842c commit d597e11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ Controller.prototype._sendCommand = function(command, cb) {
var self = this;

self.port.write(command + '\r\n', function(err) {
if (err) {
self.emit('log', util.format(
'Error sending command "%s": %s',
command,
err.message
));
}
if (typeof cb === 'function') {
cb(err);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"express" : "^4.13.4",
"js-yaml" : "^3.6.1",
"moment" : "^2.13.0",
"serialport" : "^3.1.2",
"serialport" : "^4.0.7",
"split" : "^1.0.0"
}
}

0 comments on commit d597e11

Please sign in to comment.