Skip to content

Commit

Permalink
Fix queue build up issue in gpsd_client (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikboto committed Oct 26, 2023
1 parent bec832e commit 113782d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gpsd_client/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ namespace gpsd_client
if (!gps_->waiting(1e6))
return;

gps_data_t* p = gps_->read();
// Read out all queued data and only act on the latest
gps_data_t* p = NULL;
while (gps_->waiting(0))
{
p = gps_->read();
}

#else
gps_data_t *p = gps->poll();
#endif
Expand Down

0 comments on commit 113782d

Please sign in to comment.