Skip to content

Commit

Permalink
android:gb activity tracks continued development
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Jun 16, 2023
1 parent 866c850 commit 5876509
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions apps/android/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,24 @@
lastSteps = steps;
}, event.int*1000);
},
"fetchRec": function() {
// TODO: Loop from last fetched log up to current date and through the whole alphabet for the last letter.


"listRecs": function() {
let recs = require("Storage").list(/^recorder\.log.*\.csv$/,{sf:true}).map(s => s.slice(12, 21));
Bluetooth.println(JSON.stringify({t:"tracksList", list: recs})); // TODO: split up in multiple transmissions?
},

"fetchRec": function() { // GB({t:"fetchRec", id:"20230616a"})
// TODO: Decide on what names keys should have.
let lastLog = event.lastFetchedLog;
let log = require("Storage").open("recorder.log"+lastLog+".csv","r"); // TODO: Change to loop variable.
let logString = log.read(log.getLength());
Bluetooth.println(JSON.stringify({t:"activityTrack", csv:logString, currentLog:"log name here"}));
let log = require("Storage").open("recorder.log"+event.id+".csv","r");
let line = log.readLine();
while (line) {
Bluetooth.println(JSON.stringify({t:"actTrk", log:event.id, line:line}));
line = log.readLine();
}
},


"nav": function() {
event.id="nav";
if (event.instr) {
Expand Down

0 comments on commit 5876509

Please sign in to comment.