diff --git a/apps/setting/ChangeLog b/apps/setting/ChangeLog index 1a7681595..42a44fb72 100644 --- a/apps/setting/ChangeLog +++ b/apps/setting/ChangeLog @@ -89,3 +89,5 @@ of 'Select Clock' 0.78: Fix menu scroll restore on BangleJS1 0.79: Ensure that tapping on pressure/altitude doesn't cause a menu to display temporarily 0.80: Add option to set LCD brightness to 0, keep default brightness at 1. +0.81: Ensure 'Privacy' (address randomnisation) is only added for Bangle.js 2, + and add warnings in documentation that it can cause connection issues diff --git a/apps/setting/README.md b/apps/setting/README.md index 4ed99edcc..58991d2d5 100644 --- a/apps/setting/README.md +++ b/apps/setting/README.md @@ -14,7 +14,7 @@ This is Bangle.js's main settings menu: * **Locale** Set whether you want 12 hour time, and what day of the week the week starts on. See below for options under each heading: - + ## Apps - App-specific settings This is where you adjust settings for an individual app. (eg. Health app: Adjust how often heart rate tracking should fire.) @@ -45,6 +45,8 @@ This is where you adjust settings for an individual app. (eg. Health app: Adjust * **Passkey** allows you to set a passkey that is required to connect and pair to Bangle.js. * **Whitelist** allows you to specify only specific devices that you will let connect to your Bangle.js. Simply choose the menu item, then `Add Device`, and then connect to Bangle.js with the device you want to add. If you are already connected you will have to disconnect first. Changes will take effect when you exit the `Settings` app. * **NOTE:** iOS devices and newer Android devices often implement Address Randomisation and change their Bluetooth address every so often. If you device's address changes, you will be unable to connect until you update the whitelist again. +* **Privacy** - (Bangle.js 2 only) enables BLE privacy mode (see [NRF.setSecurity](https://www.espruino.com/Reference#l_NRF_setSecurity)). This randomises the Bangle's MAC address and can also +remove advertising of its name. **This can cause connection issues with apps that expect to keep a permanent connection like iOS/Gadgetbridge** ## LCD diff --git a/apps/setting/metadata.json b/apps/setting/metadata.json index c7ba12e09..bfb0f3d7f 100644 --- a/apps/setting/metadata.json +++ b/apps/setting/metadata.json @@ -1,7 +1,7 @@ { "id": "setting", "name": "Settings", - "version": "0.80", + "version": "0.81", "description": "A menu for setting up Bangle.js", "icon": "settings.png", "tags": "tool,system", diff --git a/apps/setting/settings.js b/apps/setting/settings.js index 777131b5e..c236280aa 100644 --- a/apps/setting/settings.js +++ b/apps/setting/settings.js @@ -192,7 +192,7 @@ function BLEMenu() { var hidN = [/*LANG*/"Off", /*LANG*/"Kbrd & Media", /*LANG*/"Kbrd", /*LANG*/"Kbrd & Mouse", /*LANG*/"Joystick"]; var privacy = [/*LANG*/"Off", /*LANG*/"Show name", /*LANG*/"Hide name"]; - return { + var menu = { '': { 'title': /*LANG*/'Bluetooth' }, '< Back': ()=>popMenu(mainMenu()), /*LANG*/'Make Connectable': ()=>makeConnectable(), @@ -210,7 +210,32 @@ function BLEMenu() { updateSettings(); } }, - /*LANG*/'Privacy': { + /*LANG*/'HID': { + value: Math.max(0,0 | hidV.indexOf(settings.HID)), + min: 0, max: hidN.length-1, + format: v => hidN[v], + onchange: v => { + settings.HID = hidV[v]; + updateSettings(); + } + }, + /*LANG*/'Passkey': { + value: settings.passkey?settings.passkey:/*LANG*/"none", + onchange: () => setTimeout(() => pushMenu(passkeyMenu())) // graphical_menu redraws after the call + }, + /*LANG*/'Whitelist': { + value: + ( + (settings.whitelist_disabled || !settings.whitelist) ? /*LANG*/"Off" : /*LANG*/"On" + ) + ( + settings.whitelist + ? " (" + settings.whitelist.length + ")" + : "" + ), + onchange: () => setTimeout(() => pushMenu(whitelistMenu())) // graphical_menu redraws after the call + } + }; + if (BANGLEJS2) menu[/*LANG*/'Privacy'] = { min: 0, max: privacy.length-1, format: v => privacy[v], value: (() => { @@ -235,32 +260,8 @@ function BLEMenu() { } updateSettings(); } - }, - /*LANG*/'HID': { - value: Math.max(0,0 | hidV.indexOf(settings.HID)), - min: 0, max: hidN.length-1, - format: v => hidN[v], - onchange: v => { - settings.HID = hidV[v]; - updateSettings(); - } - }, - /*LANG*/'Passkey': { - value: settings.passkey?settings.passkey:/*LANG*/"none", - onchange: () => setTimeout(() => pushMenu(passkeyMenu())) // graphical_menu redraws after the call - }, - /*LANG*/'Whitelist': { - value: - ( - (settings.whitelist_disabled || !settings.whitelist) ? /*LANG*/"off" : /*LANG*/"on" - ) + ( - settings.whitelist - ? " (" + settings.whitelist.length + ")" - : "" - ), - onchange: () => setTimeout(() => pushMenu(whitelistMenu())) // graphical_menu redraws after the call - } - }; + }; + return menu; } function showThemeMenu(pop) {