Package Exports
- bluetooth-hci-socket
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bluetooth-hci-socket) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-bluetooth-hci-socket
Bluetooth HCI socket binding for Node.js
NOTE: Currently only supports Linux.
Install
npm install bluetooth-hci-socket
Usage
var BluetoothHciSocket = require('bluetooth-hci-socket');
Actions
Create
var bluetoothHciSocket = new BluetoothHciSocket();
Set Filter
var filter = new Buffer(14);
// ...
bluetoothHciSocket.setFilter(filter);
Bind
bluetoothHciSocket.bind();
Start/stop
Start or stop event handling:
bluetoothHciSocket.start();
// ...
bluetoothHciSocket.stop();
Write
var data = new Buffer(/* ... */);
// ...
bluetoothHciSocket.write(data);
Events
Data
bluetoothHciSocket.on('data', function(data) {
// data is a Buffer
// ...
});
Error
bluetoothHciSocket.on('error', function(error) {
// error is a Error
// ...
});
Examples
See examples folder for code examples.