Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Fix denodeified drain method
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Sep 28, 2014
1 parent 961ff77 commit 95cfba9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/serialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports.SerialPort = function (timeout) {
baudrate: 500000
}, false);

this.open = denodeify(serialPort.open.bind(serialPort), Promise);
this.open = denodeify(serialPort.open.bind(serialPort), Promise, 0);

this.read = function () {
return new Promise(function (fulfill, reject) {
Expand Down Expand Up @@ -47,8 +47,8 @@ exports.SerialPort = function (timeout) {
});
};

var drain = denodeify(serialPort.drain.bind(serialPort), Promise);
var write = denodeify(serialPort.write.bind(serialPort), Promise);
var drain = denodeify(serialPort.drain.bind(serialPort), Promise, 0);
var write = denodeify(serialPort.write.bind(serialPort), Promise, 1);

this.write = function (data) {
return write(data).then(drain);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
},
"dependencies": {
"es6-promise": "~1.0.0",
"promise-denodeify": "~1.0.0",
"promise-denodeify": "~1.1.0",
"serialport": "~1.4.6",
"typesystem": "~1.2.2"
"typesystem": "~1.2.3"
},
"devDependencies": {
"extended-assert": "~1.4.1",
Expand Down

0 comments on commit 95cfba9

Please sign in to comment.