bluetooth

Get or set Bluetooth state.

bluetooth

Get or set Bluetooth state.

Currently OS X systems only

$ npm install --save bluetooth
var bluetooth = require('bluetooth');
 
bluetooth.isOn(function (errstate) {
    console.log(state);
    //=> false 
});
 
bluetooth.on(function (err) {
    console.log('Bluetooth state changed to on');
});
 
bluetooth.off(function (err) {
    console.log('Bluetooth state changed to off');
});
 
bluetooth.toggle(function (err) {
    console.log('Bluetooth state changed to on');
});
$ npm install --global bluetooth
$ bluetooth --help
 
  Example
    $ bluetooth
    $ bluetooth on
    $ bluetooth off

Check if bluetooth is on or off.

Turn bluetooth on.

Turn bluetooth off.

Toggle the bluetooth state.

Type: boolean

Force a state when toggling.

MIT © Andreas Gillström