mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
Merge pull request #704 from pabigot/bugfix/file_descriptor_0
add pieces missed in pr #703
This commit is contained in:
commit
bffcf9efa9
1 changed files with 2 additions and 2 deletions
|
|
@ -211,7 +211,6 @@ function SerialPortFactory(_spfOptions) {
|
|||
this.readable = true;
|
||||
this.reading = false;
|
||||
factory.SerialPortBinding.open(this.path, this.options, function (err, fd) {
|
||||
self.fd = fd;
|
||||
if (err) {
|
||||
if (callback) {
|
||||
callback(err);
|
||||
|
|
@ -220,6 +219,7 @@ function SerialPortFactory(_spfOptions) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
self.fd = fd;
|
||||
if (process.platform !== 'win32') {
|
||||
self.paused = false;
|
||||
self.serialPoller = new factory.SerialPortBinding.SerialportPoller(self.fd, function (err) {
|
||||
|
|
@ -345,7 +345,7 @@ function SerialPortFactory(_spfOptions) {
|
|||
self.pool.used -= bytesRequested - bytesRead;
|
||||
|
||||
if (bytesRead === 0) {
|
||||
if (self.fd >= 0) {
|
||||
if (self.isOpen()) {
|
||||
self.serialPoller.start();
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue