Skip to content

Commit

Permalink
Fix gpxlogger to be able to run continuously
Browse files Browse the repository at this point in the history
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

Signed-off-by: Fred Wright <[email protected]>
  • Loading branch information
rnorris authored and fhgwright committed Mar 4, 2017
1 parent 62c0840 commit dcb8bb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test_gpsmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit dcb8bb0

Please sign in to comment.