From 063929f75094dc77ca12810cefe43b757f9d68c7 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 23 Sep 2020 11:18:20 +0100 Subject: [PATCH] Handle 'RAM' as filename to allow direct uploads Add ability to upload assisted GPS data --- README.md | 3 +- apps.json | 11 ++++ apps/assistedgps/ChangeLog | 1 + apps/assistedgps/app.png | Bin 0 -> 1549 bytes apps/assistedgps/custom.html | 113 +++++++++++++++++++++++++++++++++++ core | 2 +- testing/GPS-comms.js | 4 +- 7 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 apps/assistedgps/ChangeLog create mode 100644 apps/assistedgps/app.png create mode 100644 apps/assistedgps/custom.html diff --git a/README.md b/README.md index 22a12bd5b..326599d14 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,8 @@ and which gives information about the app for the Launcher. // add an icon to allow your app to be tested "storage": [ // list of files to add to storage - {"name":"appid.js", // filename to use in storage + {"name":"appid.js", // filename to use in storage. + // If name=='RAM', the code is sent directly to Bangle.js and is not saved to a file "url":"", // URL of file to load (currently relative to apps/) "content":"..." // if supplied, this content is loaded directly "evaluate":true // if supplied, data isn't quoted into a String before upload diff --git a/apps.json b/apps.json index 7f97b6f84..284116c5e 100644 --- a/apps.json +++ b/apps.json @@ -895,6 +895,17 @@ {"name":"gpsinfo.img","url": "gps-info-icon.js","evaluate": true} ] }, + { "id": "assistedgps", + "name": "Assisted GPS Update", + "icon": "app.png", + "version":"0.01", + "description": "Downloads assisted GPS data to Bangle.js for faster GPS startup and more accurate fixes", + "custom": "custom.html", + "tags": "tool,outdoors", + "readme": "README.md", + "storage": [ + ] + }, { "id": "pomodo", "name":"Pomodoro", diff --git a/apps/assistedgps/ChangeLog b/apps/assistedgps/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/assistedgps/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/assistedgps/app.png b/apps/assistedgps/app.png new file mode 100644 index 0000000000000000000000000000000000000000..970e851397d87a1e47af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J2X$M8sfh4QFFlFnM9Raz+pWo~u&pO~5m7D$OB%pIFcu6jP^B zB6S;p_HZ__HkzKFp`No5+WL?8RlwyA@FC)NN-DG&rqu?)R06r_be(|>k?b4_P0r7> zU2&>(vv=(O77C~U00@I|PgOAer`|^DCV*-q+6iRkXQ=uxSNFj$LINPdtb5terW2T( zMm{O!QUF>cTLMPSOI6Y)B#R@4)&u}hg0xVdz2FkFItF6tT4lj_`^mG7#^+#D=B}qk zD6=MI&!~rDXL2TnG$f+=R&?CuYt}V_6!W>5Xlju$wo;^~TS(K@semq_|4g}Qj zax~%rixnuY(2liwjb~2Px5KAPIBWt-v*VGIYKKjj4`ncF8r%6wL%Xya%-$QV{Nd(2 z*YB3q!$JbZ2RiZ~sR97H{EUCDX=rTjK2#>T6ugiXi|Jz=UGa9<&BkP)QiZYl`E+Yn zGW{{1K!tW3-Pa&}+-}!#vC)SXufH!?PMWJ``Lwt#f-#eco+NNG10Dc=fUgp$o(V@8 z{N4OC`>AM!N0UIv9&OV6xN^G_H(Pb6f^gxzlz_PFnZ + + + + + +

Assisted GPS

+

GPS can take a long time (~5 minutes) to get an accurate position the first time it is used. + AGPS uploads a few hints to the GPS receiver about satellite positions that allow it + to get a faster, more accurate fix - however they are only valid for a short period of time.

+

You can upload data that covers a longer period of time, but the upload will take longer.

+
+ + + + + +
+

Click

+ + + + + + diff --git a/core b/core index c99967381..1b66c4ce1 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit c99967381280f483877c3f11ae7b0d4dc8c53e0e +Subproject commit 1b66c4ce1ba71036bcb612a2f16bbd7fbc2c66de diff --git a/testing/GPS-comms.js b/testing/GPS-comms.js index 38d4c9dde..ca0db16b6 100644 --- a/testing/GPS-comms.js +++ b/testing/GPS-comms.js @@ -16,7 +16,7 @@ function writeGPScmd(cmd) { a += d[i]; b += a; } - d.push(a,b); + d.push(a&255,b&255); Serial1.write(d); } function readGPScmd(cmd, callback) { @@ -131,7 +131,7 @@ function setUBX_MGA_INI_TIME_UTC() { dv.setUint8(9, d.getMinutes()); dv.setUint8(10, d.getSeconds()); dv.setUint16(16, 10*60); // seconds part of accuracy - 10 minutes - writeGPScmd(a.slice()); + writeGPScmd([].slice.call(a)); } setUBX_MGA_INI_TIME_UTC();