bluetooth-serial-port
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -57,2 +57,3 @@ /* | ||
self.connection = connection; | ||
self.isReading = false; | ||
self.eventLoop = setInterval(eventLoop, 100, self); | ||
@@ -98,17 +99,20 @@ successCallback(); | ||
} | ||
process.nextTick(function() { | ||
if (self.connection) { | ||
self.connection.read(function(data, size) { | ||
if (size >= 0) { | ||
self.emit('data', data); | ||
} else { | ||
self.close(); | ||
self.emit('failure', 'Error reading from the connection. The connection is lost.'); | ||
} | ||
}); | ||
} | ||
}); | ||
if (!self.isReading) { | ||
process.nextTick(function() { | ||
if (self.connection) { | ||
self.isReading = true; | ||
self.connection.read(function(data, size) { | ||
self.isReading = false; | ||
if (size >= 0) { | ||
self.emit('data', data); | ||
} else { | ||
self.close(); | ||
self.emit('failure', 'Error reading from the connection. The connection is lost.'); | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
}; | ||
})(); |
{ "name" : "bluetooth-serial-port" | ||
, "version" : "0.1.9" | ||
, "version" : "0.1.10" | ||
, "description" : "Bluetooth serial port communication for Node.js" | ||
@@ -4,0 +4,0 @@ , "author": "Eelco Cramer <eelco@hailendal.org>" |
@@ -7,12 +7,13 @@ # Bluetooth serial port communication for Node.js | ||
* Only tested on Linux | ||
* Only available on Linux and BSD like systems | ||
* Not available for Windows and Mac OS X | ||
* Currently all data is passed as strings | ||
* Tested on Linux | ||
* Available for Linux and BSD like systems | ||
* Not available (yet) for Windows and Mac OS X | ||
* Data is passed as strings | ||
# Pre-requests | ||
* Needs bluetooth development packages to build. | ||
* The bluetooth device should already be paired. | ||
* Needs Bluetooth development packages to build | ||
`apt-get install libbluetooth-dev` | ||
# Install | ||
@@ -111,2 +112,2 @@ | ||
This module is available under a [FreeBSD license](http://opensource.org/licenses/BSD-2-Clause), see also the [LICENSE file](https://raw.github.com/eelcocramer/node-bluetooth-serial-port/master/LICENSE) for details. | ||
This module is available under a [FreeBSD license](http://opensource.org/licenses/BSD-2-Clause), see the [LICENSE file](https://raw.github.com/eelcocramer/node-bluetooth-serial-port/master/LICENSE) for details. |
112
31236
11
123