gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH 2/4] Fix gpxlogger to be able to run continuously


From: Robert Norris
Subject: [gpsd-dev] [PATCH 2/4] Fix gpxlogger to be able to run continuously
Date: Sat, 4 Mar 2017 18:59:21 +0000

My mistake in adding of parameter to run for a specified number of
received packets, such that it would never enter the loop when a
count was not specified.

TESTED:
test_gpsmm runs practically forever;
 or ends when the specified count is reached
---
 test_gpsmm.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test_gpsmm.cpp b/test_gpsmm.cpp
index d9668f5b..452b595e 100644
--- a/test_gpsmm.cpp
+++ b/test_gpsmm.cpp
@@ -111,7 +111,7 @@ static void libgps_dump_state(struct gps_data_t *collect)
 
 int main(int argc, char *argv[])
 {
-    uint looper = 0;
+    uint looper = UINT_MAX;
 
     // A typical C++ program may look to use a more native option parsing 
method
     //  such as boost::program_options
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
     // If not specified then by default it loops until ll simply goes out of 
bounds
     // So with the 5 second wait & a 4 byte uint - this equates to ~680 years
     //  - long enough for a test program :)
-    for (uint ll = 0; ll < looper ; ll++) {
+    for (uint ll = 0; ll < looper; ll++) {
        struct gps_data_t* newdata;
 
        if (!gps_rec.waiting(5000000))
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]