Connection seems more reliable on B2 with "active:true" request.
parent
3b7f47d17b
commit
18efaed647
|
|
@ -64,7 +64,7 @@ function getSensorBatteryLevel(gatt) {
|
||||||
|
|
||||||
function connection_setup() {
|
function connection_setup() {
|
||||||
log("Scanning for CoreTemp sensor...");
|
log("Scanning for CoreTemp sensor...");
|
||||||
NRF.requestDevice({timeout : 20000, filters : [ {namePrefix : 'CORE'} ]})
|
NRF.requestDevice({active:true,timeout : 20000, filters : [ {namePrefix : 'CORE'} ]})
|
||||||
.then(function(d) {
|
.then(function(d) {
|
||||||
device = d;
|
device = d;
|
||||||
log("Found device");
|
log("Found device");
|
||||||
|
|
@ -88,7 +88,6 @@ function connection_setup() {
|
||||||
.then(function() {
|
.then(function() {
|
||||||
log("Done!");
|
log("Done!");
|
||||||
// getSensorBatteryLevel(gatt);
|
// getSensorBatteryLevel(gatt);
|
||||||
// g.reset().clearRect(Bangle.appRect).flip();
|
|
||||||
})
|
})
|
||||||
.catch(function(e) {
|
.catch(function(e) {
|
||||||
log(e.toString(), "ERROR");
|
log(e.toString(), "ERROR");
|
||||||
|
|
@ -112,6 +111,4 @@ if (settings.enabled) {
|
||||||
|
|
||||||
E.on('kill', () => { connection_end(); });
|
E.on('kill', () => { connection_end(); });
|
||||||
|
|
||||||
// Bangle.loadWidgets();
|
|
||||||
// Bangle.drawWidgets();
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue