Connection seems more reliable on B2 with "active:true" request.

pull/1189/head
Ivor Hewitt 2021-12-30 06:53:53 +00:00
parent 3b7f47d17b
commit 18efaed647
1 changed files with 1 additions and 4 deletions

View File

@ -64,7 +64,7 @@ function getSensorBatteryLevel(gatt) {
function connection_setup() {
log("Scanning for CoreTemp sensor...");
NRF.requestDevice({timeout : 20000, filters : [ {namePrefix : 'CORE'} ]})
NRF.requestDevice({active:true,timeout : 20000, filters : [ {namePrefix : 'CORE'} ]})
.then(function(d) {
device = d;
log("Found device");
@ -88,7 +88,6 @@ function connection_setup() {
.then(function() {
log("Done!");
// getSensorBatteryLevel(gatt);
// g.reset().clearRect(Bangle.appRect).flip();
})
.catch(function(e) {
log(e.toString(), "ERROR");
@ -112,6 +111,4 @@ if (settings.enabled) {
E.on('kill', () => { connection_end(); });
// Bangle.loadWidgets();
// Bangle.drawWidgets();
})();