forked from FOSS/BangleApps
Merge pull request #2807 from AnotherStranger/feature/support-hrm-further
[bootgatthrm] Added BLE sensor location and tuned HRM service advertisement settingsmaster
commit
780337971f
|
@ -1 +1,2 @@
|
|||
0.01: Initial release.
|
||||
0.02: Added compatibility to OpenTracks and added HRM Location
|
|
@ -4,14 +4,30 @@
|
|||
* This function prepares BLE heart rate Advertisement.
|
||||
*/
|
||||
|
||||
NRF.setAdvertising(
|
||||
{
|
||||
0x180d: undefined
|
||||
},
|
||||
{
|
||||
// We need custom Advertisement settings for Apps like OpenTracks
|
||||
connectable: true,
|
||||
discoverable: true,
|
||||
scannable: true,
|
||||
whenConnected: true,
|
||||
}
|
||||
);
|
||||
|
||||
NRF.setServices({
|
||||
0x180D: { // heart_rate
|
||||
0x2A37: { // heart_rate_measurement
|
||||
notify: true,
|
||||
value: [0x06, 0],
|
||||
},
|
||||
0x2A38: { // Sensor Location: Wrist
|
||||
value: 0x02,
|
||||
}
|
||||
}
|
||||
}, { advertise: [0x180d] });
|
||||
});
|
||||
|
||||
}
|
||||
function updateBLEHeartRate(hrm) {
|
||||
|
@ -23,11 +39,11 @@
|
|||
NRF.updateServices({
|
||||
0x180D: {
|
||||
0x2A37: {
|
||||
value: [
|
||||
0x06, //
|
||||
hrm.bpm
|
||||
],
|
||||
value: [0x06, hrm.bpm],
|
||||
notify: true
|
||||
},
|
||||
0x2A38: {
|
||||
value: 0x02,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "bootgatthrm",
|
||||
"name": "BLE GATT HRM Service",
|
||||
"shortName": "BLE HRM Service",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "Adds the GATT HRM Service to advertise the measured HRM over Bluetooth.\n",
|
||||
"icon": "bluetooth.png",
|
||||
"type": "bootloader",
|
||||
|
|
Loading…
Reference in New Issue