Skip to content

Commit

Permalink
V0.06 - changed HR characteristic to match official BLE UUIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
jones139 committed Oct 4, 2023
1 parent d05a509 commit 7ff5865
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/openseizure/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
0.03: Corrected service and characteristic UUIDs to match V4.2.x of OSD app.
0.04: Fixing issue with OSD JSON specification
0.05: Added heart rate characteristic
0.06: Changed heart rate characteristic to use the official UUIDs.
2 changes: 1 addition & 1 deletion apps/openseizure/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "openseizure",
"name": "OpenSeizureDetector Widget",
"shortName": "OSD",
"version": "0.05",
"version": "0.06",
"description": "[BETA!] A widget to work alongside [OpenSeizureDetector](https://www.openseizuredetector.org.uk/)",
"icon": "widget.png",
"type": "widget",
Expand Down
30 changes: 29 additions & 1 deletion apps/openseizure/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const CHAR_OSD_ACC_DATA = "000085ea-0000-1000-8000-00805f9b34fb";
const CHAR_OSD_BAT_DATA = "000085eb-0000-1000-8000-00805f9b34fb";
const CHAR_OSD_HR_DATA = "000085ec-0000-1000-8000-00805f9b34fb";

// Official BLE UUIDs from https://btprodspecificationrefs.blob.core.windows.net/assigned-numbers/Assigned%20Number%20Types/Assigned_Numbers.pdf
// Also based on bootgathrm bangle app.
const SERV_HRM = 0x180D; // Official BLE UUID
const CHAR_HRM = 0x2A37; // Official BLE UUID
const CHAR_HR_LOC = 0x2A38; // Official BLE Sensor Location UUID

(() => {
var accelData = new Uint8Array(20);
var accelIdx = 0;
Expand Down Expand Up @@ -44,14 +50,23 @@ const CHAR_OSD_HR_DATA = "000085ec-0000-1000-8000-00805f9b34fb";
value : hrVal,
notify : true
};
var charBleHrm = {
value : [0x06, hrVal], // Check what 0x06 is?
notify : true
};


var servOsd = {};
servOsd[CHAR_OSD_ACC_DATA] = charOsdAccData;
servOsd[CHAR_OSD_BAT_DATA] = charOsdBatData;
servOsd[CHAR_OSD_HR_DATA] = charOsdHrData;
var servHrm = {};
servHrm[CHAR_HRM] = charBleHrm;

var servicesCfg = {};
servicesCfg[SERV_OSD] = servOsd;

servicesCfg[SERV_HRM] = servHrm;

NRF.updateServices(servicesCfg);
} catch(e) {}
}
Expand Down Expand Up @@ -90,12 +105,25 @@ const CHAR_OSD_HR_DATA = "000085ec-0000-1000-8000-00805f9b34fb";
readable : true,
notify : true
};
var charBleHrm = {
value : [0x06, 0], // Check what 0x06 is?
maxLen : 2,
readable : true,
notify : true
};
var charBleHrLoc = { // Sensor Location: Wrist
value : 0x02,
};
var servOsd = {};
servOsd[CHAR_OSD_ACC_DATA] = charOsdAccData;
servOsd[CHAR_OSD_BAT_DATA] = charOsdBatData;
servOsd[CHAR_OSD_HR_DATA] = charOsdHrData;
var servHrm = {};
servHrm[CHAR_HRM] = charBleHrm;
servHrm[CHAR_HR_LOC] = charBleHrLoc;
var servicesCfg = {};
servicesCfg[SERV_OSD] = servOsd;
servicesCfg[SERV_HRM] = servHrm;

NRF.setServices(servicesCfg);

Expand Down

0 comments on commit 7ff5865

Please sign in to comment.