Simple library to connect with Bluetooth devices.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
1.0.0
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.1.6
1.1.7
1.1.8
2.0.0
2.0.1
2.0.2
2.0.3
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5
3.0.6
3.0.7
3.0.8
3.0.9
blueapp-wb
.gitignore
README.md
blueapp.io.min.js
bower.json
getting-started.md
implementation-status.md
package.json

README.md

BlueApp.io

Blueapp.io is fast, easy to use and feature-rich Web Bluetooth library. It is based on Web Bluetooth spec, and enables developers to create apps for web and mobile for discovering, connecting, and listening for advertisement of bluetooth devices. You can use this library to create apps for the Blueapp platform or for your personal bluetooth needs.

To get started, check out instructions page.

To look at the current feature support, and comparison between different platforms check implementation status page.

Quick start

  • Add source to index.html:
<script src="https://blueappio.github.io/blueapp.io/blueapp.io.min.js"></script>
  • Install via bower:
bower install blueapp.io --save
  • Install via npm:
npm install blueapp.io --save

Quick Overview:

Device discovery

Feature Supported functions
requestDevice() navigator.bluetooth.requestDevice(options)

Scanning

Feature Supported functions
requestLEScan() navigator.bluetooth.requestLEScan(options)

BluetoothDevice

Bluetooth device object retured in promise from requestDevice(). Available functions:

Supported functions Description
watchAdvertisement() listening for advertisement of devices found
unwatchAdvertisement() stops listening for advertisement
gatt.connect() connecting to the device from gattServer
watchAdvertisement() listening for advertisement of devices found
unwatchAdvertisement() stops listening for advertisement

Server

Server object returned in promise from gatt.connect(). Available functions:

Supported functions Description
getPrimaryService(uuid) promise returns passed service from server if available

Service

Service object returned in promise from getPrimaryService(). Abaliable functions:

Supported functions Description
getCharacteristic(uuid) promise returns passed characteristic from service if available
getCharacteristics(uuids) promise returns array from passed characteristics from service if available

Characteristic

Characteristic object returned in promise from getCharacteristic(). Avaliable functions:

Supported functions Description
getDescriptor(uuid) promise returns passed descriptor from characteristic if available
getDescriptors(uuids) promise returns array of passed descriptors from characteristic if available
readValue() promise returns DataView containing the data
writeValue() Bytes to be written Uint8Array
startNotifications() start notifying for value changes
stopNotifications() stop notifying for value changes

Descriptor

Descriptor object returned in promise from getDescriptor(). Available functions:

Supported functions Description
readValue() promise returns DataView containing the data
writeValue() Bytes to be written Uint8Array

Events

Supported events fired on
advertisementreceived BluetoothDevice object
gattserverdisconnected BluetoothDevice object
characteristicvaluechanged Characteristic object

Extra Material

Check the other repos for examples.