Package Exports
- simble
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simble) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.