Skip to content

Commit

Permalink
android: use gbSend for gb activity tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Oct 21, 2023
1 parent ec94d3f commit 47148e1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apps/android/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,25 +232,22 @@
recs = recs.slice(recs.indexOf(event.id)); // FIXME: Currently does not handle if the last fetched log was deleted on the watch, so that there won't be any entry corresponding to `event.id`
recs.shift();
}
Bluetooth.println("");
Bluetooth.println(JSON.stringify({t:"trksList", list: recs})); // TODO: split up in multiple transmissions?
gbSend({t:"trksList", list: recs}); // TODO: split up in multiple transmissions?
},

"fetchRec": function() { // GB({t:"fetchRec", id:"20230616a"})
// TODO: Decide on what names keys should have.
let log = require("Storage").open("recorder.log"+event.id+".csv","r");
let line = log.readLine();
while (line) {
Bluetooth.println("");
Bluetooth.println(JSON.stringify({t:"actTrk", log:event.id, line:line, last:"false"}));
gbSend({t:"actTrk", log:event.id, line:line, last:"false"});
line = log.readLine();
if (!line) {
Bluetooth.println(JSON.stringify({t:"actTrk", log:event.id, line:"end of recorder log", last:event.last}));
gbSend({t:"actTrk", log:event.id, line:"end of recorder log", last:event.last});
}
}
},


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

0 comments on commit 47148e1

Please sign in to comment.