Skip to content

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

Notifications You must be signed in to change notification settings

evanxd/blue-yeast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlueYeast

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 Device

var ble = Bluetooth.connect('BT_NAME', 'e4:a9:35:a4:e:10');

Send Data

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

Subscribe Notifications

ble.startNotifications();
ble.on('data', function(evt) {
  console.log('data: ' + JSON.stringify(evt));
});

Reconnect Device

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

Ongoing Work