parent
1f1b8a20d5
commit
aedd05af70
|
|
@ -3,3 +3,5 @@
|
||||||
0.03: Do not load AGPS data on boot
|
0.03: Do not load AGPS data on boot
|
||||||
Increase minimum interval to 6 hours
|
Increase minimum interval to 6 hours
|
||||||
0.04: Write AGPS data chunks with delay to improve reliability
|
0.04: Write AGPS data chunks with delay to improve reliability
|
||||||
|
0.05: Show last success date
|
||||||
|
Do not start A-GPS update automatically
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,26 @@ Bangle.drawWidgets();
|
||||||
|
|
||||||
let waiting = false;
|
let waiting = false;
|
||||||
|
|
||||||
function start() {
|
function start(restart) {
|
||||||
g.reset();
|
g.reset();
|
||||||
g.clear();
|
g.clear();
|
||||||
waiting = false;
|
waiting = false;
|
||||||
|
if (!restart) {
|
||||||
|
display("Start?", "touch to start");
|
||||||
|
}
|
||||||
|
else {
|
||||||
display("Retry?", "touch to retry");
|
display("Retry?", "touch to retry");
|
||||||
|
}
|
||||||
Bangle.on("touch", () => { updateAgps(); });
|
Bangle.on("touch", () => { updateAgps(); });
|
||||||
|
|
||||||
|
const file = "agpsdata.json";
|
||||||
|
let data = require("Storage").readJSON(file, 1) || {};
|
||||||
|
if (data.lastUpdate) {
|
||||||
|
g.setFont("Vector", 11);
|
||||||
|
g.drawString("last success:", 5, g.getHeight() - 22);
|
||||||
|
g.drawString(new Date(data.lastUpdate).toISOString(), 5, g.getHeight() - 11);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateAgps() {
|
function updateAgps() {
|
||||||
|
|
@ -36,7 +50,7 @@ function updateAgps() {
|
||||||
g.clear();
|
g.clear();
|
||||||
if (!waiting) {
|
if (!waiting) {
|
||||||
waiting = true;
|
waiting = true;
|
||||||
display("Updating A-GPS...", "takes ~ 10 seconds");
|
display("Updating A-GPS...", "takes ~10 seconds");
|
||||||
require("agpsdata").pull(function() {
|
require("agpsdata").pull(function() {
|
||||||
waiting = false;
|
waiting = false;
|
||||||
display("A-GPS updated.", "touch to close");
|
display("A-GPS updated.", "touch to close");
|
||||||
|
|
@ -45,10 +59,10 @@ function updateAgps() {
|
||||||
function(error) {
|
function(error) {
|
||||||
waiting = false;
|
waiting = false;
|
||||||
E.showAlert(error, "Error")
|
E.showAlert(error, "Error")
|
||||||
.then(() => { start(); });
|
.then(() => { start(true); });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
display("Waiting...");
|
display("Waiting...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateAgps();
|
start(false);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "A-GPS Data Downloader App",
|
"name": "A-GPS Data Downloader App",
|
||||||
"shortName":"A-GPS Data",
|
"shortName":"A-GPS Data",
|
||||||
"icon": "agpsdata.png",
|
"icon": "agpsdata.png",
|
||||||
"version":"0.04",
|
"version":"0.05",
|
||||||
"description": "Once installed, this app allows you to download assisted GPS (A-GPS) data directly to your Bangle.js **via Gadgetbridge on an Android phone** when you run the app. If you just want to upload the latest AGPS data from this app loader, please use the `Assisted GPS Update (AGPS)` app.",
|
"description": "Once installed, this app allows you to download assisted GPS (A-GPS) data directly to your Bangle.js **via Gadgetbridge on an Android phone** when you run the app. If you just want to upload the latest AGPS data from this app loader, please use the `Assisted GPS Update (AGPS)` app.",
|
||||||
"tags": "boot,tool,assisted,gps,agps,http",
|
"tags": "boot,tool,assisted,gps,agps,http",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue