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.01: Initial release.
|
||||||
|
0.02: Added compatibility to OpenTracks and added HRM Location
|
|
@ -4,14 +4,30 @@
|
||||||
* This function prepares BLE heart rate Advertisement.
|
* 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({
|
NRF.setServices({
|
||||||
0x180D: { // heart_rate
|
0x180D: { // heart_rate
|
||||||
0x2A37: { // heart_rate_measurement
|
0x2A37: { // heart_rate_measurement
|
||||||
notify: true,
|
notify: true,
|
||||||
value: [0x06, 0],
|
value: [0x06, 0],
|
||||||
|
},
|
||||||
|
0x2A38: { // Sensor Location: Wrist
|
||||||
|
value: 0x02,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, { advertise: [0x180d] });
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
function updateBLEHeartRate(hrm) {
|
function updateBLEHeartRate(hrm) {
|
||||||
|
@ -23,11 +39,11 @@
|
||||||
NRF.updateServices({
|
NRF.updateServices({
|
||||||
0x180D: {
|
0x180D: {
|
||||||
0x2A37: {
|
0x2A37: {
|
||||||
value: [
|
value: [0x06, hrm.bpm],
|
||||||
0x06, //
|
|
||||||
hrm.bpm
|
|
||||||
],
|
|
||||||
notify: true
|
notify: true
|
||||||
|
},
|
||||||
|
0x2A38: {
|
||||||
|
value: 0x02,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "bootgatthrm",
|
"id": "bootgatthrm",
|
||||||
"name": "BLE GATT HRM Service",
|
"name": "BLE GATT HRM Service",
|
||||||
"shortName": "BLE 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",
|
"description": "Adds the GATT HRM Service to advertise the measured HRM over Bluetooth.\n",
|
||||||
"icon": "bluetooth.png",
|
"icon": "bluetooth.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
Loading…
Reference in New Issue