settings: Make Connectable temporarily bypasses the whitelist
parent
77fd3a0c7d
commit
37c0571b97
|
|
@ -66,3 +66,4 @@
|
||||||
If settings.bootDebug is set, output timing for each section of .boot0
|
If settings.bootDebug is set, output timing for each section of .boot0
|
||||||
0.56: Settings.log = 0,1,2,3 for off,display, log, both
|
0.56: Settings.log = 0,1,2,3 for off,display, log, both
|
||||||
0.57: Handle the whitelist being disabled
|
0.57: Handle the whitelist being disabled
|
||||||
|
0.58: "Make Connectable" temporarily bypasses the whitelist
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ 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.options) boot+=`Bangle.setOptions(${E.toJS(s.options)});\n`;
|
||||||
if (s.brightness && s.brightness!=1) boot+=`Bangle.setLCDBrightness(${s.brightness});\n`;
|
if (s.brightness && s.brightness!=1) boot+=`Bangle.setLCDBrightness(${s.brightness});\n`;
|
||||||
if (s.passkey!==undefined && s.passkey.length==6) boot+=`NRF.setSecurity({passkey:${E.toJS(s.passkey.toString())}, mitm:1, display:1});\n`;
|
if (s.passkey!==undefined && s.passkey.length==6) boot+=`NRF.setSecurity({passkey:${E.toJS(s.passkey.toString())}, mitm:1, display:1});\n`;
|
||||||
if (s.whitelist && !s.whitelist_disabled) boot+=`NRF.on('connect', function(addr) { if (!(require('Storage').readJSON('setting.json',1)||{}).whitelist.includes(addr)) NRF.disconnect(); });\n`;
|
if (s.whitelist && !s.whitelist_disabled) boot+=`NRF.on('connect', function(addr) { if (!NRF.ignoreWhitelist && !(require('Storage').readJSON('setting.json',1)||{}).whitelist.includes(addr)) NRF.disconnect(); });\n`;
|
||||||
if (s.rotate) boot+=`g.setRotation(${s.rotate&3},${s.rotate>>2});\n` // screen rotation
|
if (s.rotate) boot+=`g.setRotation(${s.rotate&3},${s.rotate>>2});\n` // screen rotation
|
||||||
// ================================================== FIXING OLDER FIRMWARES
|
// ================================================== FIXING OLDER FIRMWARES
|
||||||
if (FWVERSION<215.068) // 2v15.68 and before had compass heading inverted.
|
if (FWVERSION<215.068) // 2v15.68 and before had compass heading inverted.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "boot",
|
"id": "boot",
|
||||||
"name": "Bootloader",
|
"name": "Bootloader",
|
||||||
"version": "0.57",
|
"version": "0.58",
|
||||||
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
|
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
|
||||||
"icon": "bootloader.png",
|
"icon": "bootloader.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
|
||||||
|
|
@ -66,4 +66,5 @@ of 'Select Clock'
|
||||||
0.58: On/Off settings items now use checkboxes
|
0.58: On/Off settings items now use checkboxes
|
||||||
0.59: Preserve BLE whitelist even when disabled
|
0.59: Preserve BLE whitelist even when disabled
|
||||||
0.60: Moved LCD calibration to top of menu, and use 12 taps (not 8)
|
0.60: Moved LCD calibration to top of menu, and use 12 taps (not 8)
|
||||||
LCD calibration will now error if the calibration is obviously wrong
|
LCD calibration will now error if the calibration is obviously wrong
|
||||||
|
0.61: Permit temporary bypass of the BLE whitelist
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "setting",
|
"id": "setting",
|
||||||
"name": "Settings",
|
"name": "Settings",
|
||||||
"version": "0.60",
|
"version": "0.61",
|
||||||
"description": "A menu for setting up Bangle.js",
|
"description": "A menu for setting up Bangle.js",
|
||||||
"icon": "settings.png",
|
"icon": "settings.png",
|
||||||
"tags": "tool,system",
|
"tags": "tool,system",
|
||||||
|
|
|
||||||
|
|
@ -658,6 +658,7 @@ function showUtilMenu() {
|
||||||
function makeConnectable() {
|
function makeConnectable() {
|
||||||
try { NRF.wake(); } catch (e) { }
|
try { NRF.wake(); } catch (e) { }
|
||||||
Bluetooth.setConsole(1);
|
Bluetooth.setConsole(1);
|
||||||
|
NRF.ignoreWhitelist = 1;
|
||||||
var name = "Bangle.js " + NRF.getAddress().substr(-5).replace(":", "");
|
var name = "Bangle.js " + NRF.getAddress().substr(-5).replace(":", "");
|
||||||
E.showPrompt(name + /*LANG*/"\nStay Connectable?", { title: /*LANG*/"Connectable" }).then(r => {
|
E.showPrompt(name + /*LANG*/"\nStay Connectable?", { title: /*LANG*/"Connectable" }).then(r => {
|
||||||
if (settings.ble != r) {
|
if (settings.ble != r) {
|
||||||
|
|
@ -665,6 +666,7 @@ function makeConnectable() {
|
||||||
updateSettings();
|
updateSettings();
|
||||||
}
|
}
|
||||||
if (!r) try { NRF.sleep(); } catch (e) { }
|
if (!r) try { NRF.sleep(); } catch (e) { }
|
||||||
|
delete NRF.ignoreWhitelist;
|
||||||
showMainMenu();
|
showMainMenu();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue