bthrm - Optionally use bonding for BLE sensor
parent
0f9a117149
commit
0a1226ad1e
|
|
@ -16,5 +16,6 @@
|
||||||
"gracePeriodNotification": 0,
|
"gracePeriodNotification": 0,
|
||||||
"gracePeriodConnect": 0,
|
"gracePeriodConnect": 0,
|
||||||
"gracePeriodService": 0,
|
"gracePeriodService": 0,
|
||||||
"gracePeriodRequest": 0
|
"gracePeriodRequest": 0,
|
||||||
|
"bonding": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -439,18 +439,20 @@ exports.enable = () => {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* promise = promise.then(() => {
|
if (settings.bonding){
|
||||||
log(JSON.stringify(gatt.getSecurityStatus()));
|
promise = promise.then(() => {
|
||||||
if (gatt.getSecurityStatus()['bonded']) {
|
log(JSON.stringify(gatt.getSecurityStatus()));
|
||||||
log("Already bonded");
|
if (gatt.getSecurityStatus()['bonded']) {
|
||||||
return Promise.resolve();
|
log("Already bonded");
|
||||||
} else {
|
return Promise.resolve();
|
||||||
log("Start bonding");
|
} else {
|
||||||
return gatt.startBonding()
|
log("Start bonding");
|
||||||
.then(() => console.log(gatt.getSecurityStatus()));
|
return gatt.startBonding()
|
||||||
}
|
.then(() => console.log(gatt.getSecurityStatus()));
|
||||||
});*/
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
promise = promise.then(()=>{
|
promise = promise.then(()=>{
|
||||||
if (!characteristics || characteristics.length === 0){
|
if (!characteristics || characteristics.length === 0){
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,12 @@
|
||||||
writeSettings("debuglog",v);
|
writeSettings("debuglog",v);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'Use bonding': {
|
||||||
|
value: !!settings.bonding,
|
||||||
|
onchange: v => {
|
||||||
|
writeSettings("bonding",v);
|
||||||
|
}
|
||||||
|
},
|
||||||
'Grace periods': function() { E.showMenu(submenu_grace); }
|
'Grace periods': function() { E.showMenu(submenu_grace); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue