Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bluetooth-hci-socket

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluetooth-hci-socket

Bluetooth HCI socket binding for Node.js

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-17.19%
Maintainers
1
Weekly downloads
 
Created
Source

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();
Address

Get the device (Bluetooth/BT) address. Note: must be called after bind.

var btAddress = bluetoothHciSocket.getAddress();
Address Type

Get the device (Bluetooth/BT) address type. Note: must be called after bind.

var btAddressType = bluetoothHciSocket.getAddressType(); // returns: 'public' or 'random'
Is Device Up

Query the device state. Note: must be called after bind.

var isDevUp = bluetoothHciSocket.isDevUp(); // returns: true or false
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.

Keywords

FAQs

Package last updated on 13 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc