mirror of https://github.com/espruino/BangleApps
Merge pull request #3235 from nxdefiant/master
cscsensor: Automatically reconnect on errorpull/3236/head
commit
8c2e5222c8
|
@ -7,3 +7,4 @@
|
|||
Improve connection code
|
||||
0.07: Make Bangle.js 2 compatible
|
||||
0.08: Convert Yes/No On/Off in settings to checkboxes
|
||||
0.09: Automatically reconnect on error
|
||||
|
|
|
@ -226,7 +226,7 @@ function getSensorBatteryLevel(gatt) {
|
|||
function connection_setup() {
|
||||
mySensor.screenInit = true;
|
||||
E.showMessage("Scanning for CSC sensor...");
|
||||
NRF.requestDevice({ filters: [{services:["1816"]}]}).then(function(d) {
|
||||
NRF.requestDevice({ filters: [{services:["1816"]}], maxInterval: 100}).then(function(d) {
|
||||
device = d;
|
||||
E.showMessage("Found device");
|
||||
return device.gatt.connect();
|
||||
|
@ -249,6 +249,7 @@ function connection_setup() {
|
|||
}).catch(function(e) {
|
||||
E.showMessage(e.toString(), "ERROR");
|
||||
console.log(e);
|
||||
setTimeout(connection_setup, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "cscsensor",
|
||||
"name": "Cycling speed sensor",
|
||||
"shortName": "CSCSensor",
|
||||
"version": "0.08",
|
||||
"version": "0.09",
|
||||
"description": "Read BLE enabled cycling speed and cadence sensor and display readings on watch",
|
||||
"icon": "icons8-cycling-48.png",
|
||||
"tags": "outdoors,exercise,ble,bluetooth,bike,cycle,bicycle",
|
||||
|
|
Loading…
Reference in New Issue