From 8271b7472dab8dd26b20f6c6d67924d6b6a71273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20B=C3=BCsgen?= Date: Fri, 9 Jun 2023 20:50:51 +0200 Subject: [PATCH 1/2] feat: :sparkles: tune service advertisement so apps like OpenTracks can find the hrm service --- apps/bootgatthrm/boot.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/bootgatthrm/boot.js b/apps/bootgatthrm/boot.js index 391f245b9..aad210f6f 100644 --- a/apps/bootgatthrm/boot.js +++ b/apps/bootgatthrm/boot.js @@ -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, } } }); From ef197a5133ea37ba7a881b34587d5ec2a1dee1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20B=C3=BCsgen?= Date: Sat, 10 Jun 2023 12:36:59 +0200 Subject: [PATCH 2/2] docs: :bookmark: Increment version number and add ChangeLog --- apps/bootgatthrm/ChangeLog | 1 + apps/bootgatthrm/metadata.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/bootgatthrm/ChangeLog b/apps/bootgatthrm/ChangeLog index 2a37193a3..1e772af29 100644 --- a/apps/bootgatthrm/ChangeLog +++ b/apps/bootgatthrm/ChangeLog @@ -1 +1,2 @@ 0.01: Initial release. +0.02: Added compatibility to OpenTracks and added HRM Location \ No newline at end of file diff --git a/apps/bootgatthrm/metadata.json b/apps/bootgatthrm/metadata.json index e7bfb0762..450066622 100644 --- a/apps/bootgatthrm/metadata.json +++ b/apps/bootgatthrm/metadata.json @@ -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",