heartrate
A Node.js Stream for getting heart rate from Bluetooth Low Energy devices. This is experimental and tested only with the Wahoo Blue HR device.
Usage and Installation
npm install --save heartrate
var BleHR = ;var stream = 'foo12345bar1234fo12345bar1234123';stream;
API
new BleHR(UUID)
Parameter: UUID
is string with the UUID.
Returns: BleHR
instance
new BleHR(options)
or Parameter: option
is object of options.
Returns: BleHR
instance
Defaults:
uuid
is required
new BleHR(UUID).getBodyLocation([callback(error, location)])
Parameter: Function
callback with the location in string format
Returns: BleHR
instance (it self)
Get string representation of body sensor location. E.g. Chest
, Ear Lobe
.
Either get data by using the callback or listening to the bodyLocation
event.
Example:
var stream = 'foo12345bar1234fo12345bar1234123';stream;
new BleHR(UUID).getBatteryLevel([callback(error, level)])
Parameter: Function
callback with the current battery level in percentage
Returns: BleHR
instance (it self)
Get battery level of device in percentage. Interval 0
- 100
.
Either get data by using the callback or listening to the batteryLevel
event.
Example:
var stream = 'foo12345bar1234fo12345bar1234123';stream;
BleHR.list()
(static)
Returns: EventEmitter
instance
Emits all discovered devices on data
event.
Example:
BleHR;
BleHR.list.print()
(static)
Sugar for printing all devices found.
Example:
BleHRlist;// UUID: foo12345bar1234fo12345bar1234123// Local Name = Wahoo HRM v2.1// Service Data =// Service UUIDs = 180d