Skip to content

Commit

Permalink
android: tweak activity track logic
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Feb 17, 2024
1 parent f96f2f4 commit d5ecada
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions apps/android/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,27 @@
"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();
let line = "init";// = log.readLine();

while (line) {
gbSend({t:"actTrk", log:event.id, line:line, last:"false"});
line = log.readLine();
if (!line) {
gbSend({t:"actTrk", log:event.id, line:"end of recorder log", last:event.last});
}
gbSend({t:"actTrk", log:event.id, line:line});
}

//// Alternate way to send line, to try and avoid getting malformated JSON lines to Gadgetbridge.
//// My thinking is maybe the Bangle.js bt send que (??) get to full sometimes, this was an attempt to mitigate that.
//// Initial tests rendered new problems. Might come back to this.
//let sendLine = ()=>{
// line = log.readLine();
// gbSend({t:"actTrk", log:event.id, line:line});
// if (!line && fetchRecInterval) {
// clearInterval(fetchRecInterval);
// delete fetchRecInterval;
// }
//}
//fetchRecInterval = setInterval(sendLine, 100)


},

"nav": function() {
Expand Down

0 comments on commit d5ecada

Please sign in to comment.