bluetooth-serial-port
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -16,3 +16,3 @@ /* | ||
var EventEmitter = require('events').EventEmitter; | ||
var btSerial = require('bindings')("BTSerialPortBinding.node"); | ||
var btSerial = require('bindings')('BluetoothSerialPort.node'); | ||
var DeviceINQ = require("./device-inquiry.js").DeviceINQ; | ||
@@ -55,4 +55,5 @@ | ||
this.connection = new btSerial.BTSerialPortBinding(address, channel, function(err) { | ||
var connection = new btSerial.BTSerialPortBinding(address, channel, function(err) { | ||
self.buffer = []; | ||
self.connection = connection; | ||
self.eventLoop = setInterval(eventLoop, 100, self); | ||
@@ -89,3 +90,7 @@ successCallback(); | ||
for (var i in self.buffer) { | ||
self.connection.write(self.buffer[i]); | ||
if (self.connection) { | ||
self.connection.write(self.buffer[i]); | ||
} else { | ||
throw('Invalid state. No connection object to write to.'); | ||
} | ||
} | ||
@@ -92,0 +97,0 @@ |
@@ -13,3 +13,3 @@ /* | ||
// javascript shim that lets our object inherit from EventEmitter | ||
var DeviceINQ = require('bindings')('DeviceINQ.node').DeviceINQ; | ||
var DeviceINQ = require('bindings')('BluetoothSerialPort.node').DeviceINQ; | ||
@@ -16,0 +16,0 @@ var events = require('events'); |
{ "name" : "bluetooth-serial-port" | ||
, "version" : "0.1.8" | ||
, "version" : "0.1.9" | ||
, "description" : "Bluetooth serial port communication for Node.js" | ||
@@ -31,2 +31,3 @@ , "author": "Eelco Cramer <eelco@hailendal.org>" | ||
, "license": "FreeBSD" | ||
, "contributors": ["Eric Smekens", "Juho Vepsäläinen"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32380
12
153