Skip to content

Commit

Permalink
boot: only set display:1 if we have a passkey
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Jun 26, 2024
1 parent ccf6c2a commit 61b6e98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/boot/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@
0.60: Minor code improvements
0.61: Instead of breaking execution with an Exception when updating boot, just use if..else (fix 'Uncaught undefined')
0.62: Handle setting for configuring BLE privacy
0.63: Only set BLE `display:1` if we have a passkey
4 changes: 2 additions & 2 deletions apps/boot/bootupdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ if (global.save) boot += `global.save = function() { throw new Error("You can't
if (s.options) boot+=`Bangle.setOptions(${E.toJS(s.options)});\n`;
if (s.brightness && s.brightness!=1) boot+=`Bangle.setLCDBrightness(${s.brightness});\n`;
if (s.bleprivacy || (s.passkey!==undefined && s.passkey.length==6)) {
let passkey = s.passkey ? `passkey:${E.toJS(s.passkey.toString())},` : "";
let passkey = s.passkey ? `passkey:${E.toJS(s.passkey.toString())},display:1,mitm:1,` : "";
let privacy = s.bleprivacy ? `privacy:${E.toJS(s.bleprivacy)},` : "";
boot+=`NRF.setSecurity({${passkey}${privacy}mitm:1,display:1});\n`;
boot+=`NRF.setSecurity({${passkey}${privacy}});\n`;
}
if (s.blename === false) boot+=`NRF.setAdvertising({},{showName:false});\n`;
if (s.whitelist && !s.whitelist_disabled) boot+=`NRF.on('connect', function(addr) { if (!NRF.ignoreWhitelist) { let whitelist = (require('Storage').readJSON('setting.json',1)||{}).whitelist; if (NRF.resolveAddress !== undefined) { let resolvedAddr = NRF.resolveAddress(addr); if (resolvedAddr !== undefined) addr = resolvedAddr + " (resolved)"; } if (!whitelist.includes(addr)) NRF.disconnect(); }});\n`;
Expand Down
2 changes: 1 addition & 1 deletion apps/boot/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "boot",
"name": "Bootloader",
"version": "0.62",
"version": "0.63",
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
"icon": "bootloader.png",
"type": "bootloader",
Expand Down

0 comments on commit 61b6e98

Please sign in to comment.