simble
v0.2.6
Published
SIMple access to BLE (Bluetooth Low Energy = Bluetooth 4.x) devices
Downloads
36
Maintainers
Readme
simble
A node.js module for simple access to ble (Bluetooth Low Energy = Bluetooth 4.x) devices.
This module is a wrapper for sandeepmistry's great noble package, using Promises instead of callbacks and providing a somewhat different API.
Usage example
The following code (written in CoffeeScript) scans for a nearby Bluetooth LE peripheral that advertises the "Heart Rate" Service (ID: 0x180D). If such a peripheral is found, it requests the peripheral's "Heart Rate Measurement" Characteristic (ID: 0x2A37) (the peripheral will auto-connect, since a connection is required for accessing/requesting a Characteristic). It then subscribes to that characteristic; whenever updates arrive, it will print the current heart rate (byte 1 in the data) to the console.
require("simble").subscribe_to_characteristic 0x180D, 0x2A37, (heart_rate_data) ->
console.log("Heart rate: #{data[1]} bpm")
API
Unfortunately, the API is not documented yet, so there's very little reason for others to use it yet. I published it because other node.js modules of mine require it.