0.0.7 • Published 9 years ago

bluetooth-helper v0.0.7

Weekly downloads
1
License
Apache License 2....
Repository
-
Last release
9 years ago

bluetooth-helper

A wrapper for BLE APIs in FxOS. It help developers handle BLE things easier.

How to Install

  1. Declare bluetooth-helper as dependency module in bower.json. Please check bower.json.
  2. Download the module: bower install.
  3. Import the module in <head> in HTML file. html<script src="bower_components/bluetooth-helper/lib/bluetooth_helper.js"></script>
  4. Done.

How to Use

Connect the device.

var ble = new BluetoothHelper({
  // Need BLE device's name or address to connect it.
  name: 'BT_NAME',
  // address: 'e4:a9:35:a4:ee:10'
});
ble.connect();

Send data to device after connected.

ble.on('connected', function() {
  // You need to send one byte or more data in HEX format at one time.
  ble.send('EE');
});

Reconnect the device.

ble.disconnected();
ble.on('disconnected', function() {
  ble.connect();
})
0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago