gpsd-users
[Top][All Lists]
Advanced

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

So I took a look at the gps_read section of Dire Wolf


From: Don Rolph
Subject: So I took a look at the gps_read section of Dire Wolf
Date: Wed, 5 Jan 2022 16:52:33 -0500

If one looks at the dire3.log file one sees that the first TPV message after a 3D fix has been received by the rest of the code well over 100 times.  The messages are all identical.  They do not show up in the log data from gpsd received by gpspipe -W.

I did a quick scan of the code, and the following seems salient.  The reading of the gpsd data all occurs in the routine read_gpsd_thread

A highly edited version of the source is below:

static void * read_gpsd_thread (void *arg)

...

#if GPSD_API_MAJOR_VERSION >= 7
 if (gps_read (&gpsdata, NULL, 0) == -1) {
#else
 if (gps_read (&gpsdata) == -1) {
#endif

...


   if (s_debug >= 3) {
   text_color_set(DW_COLOR_DEBUG);
   dw_printf ("gpsdata: status=%d, mode=%d, lat=%.6f, lon=%.6f, track=%.1f, speed=%.1f, alt=%.0f\n",
      gpsdata.stupid_status, gpsdata.fix.mode,
      gpsdata.fix.latitude, gpsdata.fix.longitude,
      gpsdata.fix.track, gpsdata.fix.speed, gpsdata.fix.stupid_altitude);

So it appears that the process reads a record and then prints a record.  To print a new it first has to read a new record.

And we are receiving over 100 identical records which are not in the gpsd message debug log.

This would seem to indicate that gps_read is generating the spurious messages since between the gps_read and the print there is no code to cause a loop or generate a record.

Now I am not a c specialist, so I may have made an error here. But if so, the nature of the error should be able to be identified by others.

So do we know for sure that there is not a potential edge condition which can cause gps_read to generate multiple spurious identical spurious  records?

Thoughts?


--

73,
AB1PH
Don Rolph

reply via email to

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