mirror of https://github.com/espruino/BangleApps
parent
1f1b8a20d5
commit
aedd05af70
|
@ -3,3 +3,5 @@
|
|||
0.03: Do not load AGPS data on boot
|
||||
Increase minimum interval to 6 hours
|
||||
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;
|
||||
|
||||
function start() {
|
||||
function start(restart) {
|
||||
g.reset();
|
||||
g.clear();
|
||||
waiting = false;
|
||||
display("Retry?", "touch to retry");
|
||||
if (!restart) {
|
||||
display("Start?", "touch to start");
|
||||
}
|
||||
else {
|
||||
display("Retry?", "touch to retry");
|
||||
}
|
||||
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() {
|
||||
|
@ -36,7 +50,7 @@ function updateAgps() {
|
|||
g.clear();
|
||||
if (!waiting) {
|
||||
waiting = true;
|
||||
display("Updating A-GPS...", "takes ~ 10 seconds");
|
||||
display("Updating A-GPS...", "takes ~10 seconds");
|
||||
require("agpsdata").pull(function() {
|
||||
waiting = false;
|
||||
display("A-GPS updated.", "touch to close");
|
||||
|
@ -45,10 +59,10 @@ function updateAgps() {
|
|||
function(error) {
|
||||
waiting = false;
|
||||
E.showAlert(error, "Error")
|
||||
.then(() => { start(); });
|
||||
.then(() => { start(true); });
|
||||
});
|
||||
} else {
|
||||
display("Waiting...");
|
||||
}
|
||||
}
|
||||
updateAgps();
|
||||
start(false);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "A-GPS Data Downloader App",
|
||||
"shortName":"A-GPS Data",
|
||||
"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.",
|
||||
"tags": "boot,tool,assisted,gps,agps,http",
|
||||
"allow_emulator":true,
|
||||
|
|
Loading…
Reference in New Issue