Skip to content

Commit

Permalink
Port of PR #89 (#97)
Browse files Browse the repository at this point in the history
* Port of PR #89

* Fixing variable name
  • Loading branch information
danthony06 authored May 9, 2024
1 parent 52116cd commit 6b8c31f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gpsd_client/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ class GPSDClient {
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 6b8c31f

Please sign in to comment.