From: Steven Baltakatei Sandoval <baltakatei@gmail.com>
Date: Fri, 3 Jul 2020 17:16:28 +0000 (+0000)
Subject: doc(bkgpslog):Add note to simplify main loop
X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/f75428fef49de12c858fe5c8dd0ac4fca1d09a82?ds=inline

doc(bkgpslog):Add note to simplify main loop
---

diff --git a/exec/bkgpslog-plan.org b/exec/bkgpslog-plan.org
index da23704..b7cc736 100644
--- a/exec/bkgpslog-plan.org
+++ b/exec/bkgpslog-plan.org
@@ -27,11 +27,27 @@ when a new session is started.
 is checked and its status as a valid tar file is validated. This was
 done using a new function ~checkMakeTar~.
 ** DONE Add VERSION if output tar deleted between writes
+
    CLOSED: [2020-07-02 Thu 20:22]
 2020-07-02T20:21Z; bktei> Added bkgpslog-specified function
 magicWriteVersion() to be called whenever a new time-stamped ~VERSION~
 file needs to be generated and appended to the output tar file
 ~PATHOUT_TAR~.
+** TODO Rewrite buffer loop to reduce lag between gpspipe runs
+2020-07-03T17:10Z; bktei> As is, there is still a 5-6 second lag
+between when ~gpspipe~ times out at the end of a buffer round and when
+~gpspipe~ is called by the subsequent buffer round. I believe this can
+be reduced by moving variable manipulations inside the
+asynchronously-executed magicWriteBuffer() function. Ideally, the
+while loop should look like:
+
+#+BEGIN_EXAMPLE
+while( $SECONDS < $SCRIPT_TTL); do
+    gpspipe-r > "$DIR_TMP"/buffer.nmea
+    writeBuffer &
+done
+#+END_EXAMPLE
+
 * bkgpslog narrative
 ** Initialize environment
 *** Init variables