gpsd-users
[Top][All Lists]
Advanced

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

Re: Updates from 3.20 to 3.23


From: Gary E. Miller
Subject: Re: Updates from 3.20 to 3.23
Date: Tue, 21 Sep 2021 10:21:04 -0700

Yo David!

On Tue, 21 Sep 2021 16:03:59 +0100
David Taylor <gm8arv@yahoo.co.uk> wrote:

> I'm trying to get a program working which was fine under 3.20, but
> fails with 3.23-rc1.

It should just require a recompile.  Maybe a variable or two
changed names.

I assume you mean 3.23.1-rc1?  3.23.!~rc1 is obsolete.

>  I'm not very good with Linux, so it may be a
> beginner's mistake, but it may be that the structure definitions have
> changed, or my program isn't picking them up (i.e. it's getting the
> header from the wrong location).

Since it is an ~rc1, you likely installed from git.  So the headers
will be in /usr/local//include/.




> The core of the program is:
> 
> #if GPSD_API_MAJOR_VERSION >= 7
> /* from <gps_json.h> */
> #define GPS_JSON_RESPONSE_MAX   4096

That is a big problem.  Never copy a value from a header.  That value
changes.  You should always include the proper headers.

> bool showMessage = false;
> char gpsdMessage[GPS_JSON_RESPONSE_MAX];
> size_t gpsdMessageLen = 0;
> #endif
> 
> int main (int argc, char **argv) {
>    int status, used, visible;
>    struct gps_data_t gpsdata;
>    #define OID_VISIBLE ".1.3.6.1.2.1.25.1.31"
>    #define OID_USED ".1.3.6.1.2.1.25.1.32"
>    #define OID_SNR_AVG ".1.3.6.1.2.1.25.1.33"
> 
>    if ((argc > 2) && (strcmp ("-g", argv[1]) == 0))
>    {
>      status = gps_open (GPSD_SHARED_MEMORY, DEFAULT_GPSD_PORT,
> &gpsdata);
> 
> #if GPSD_API_MAJOR_VERSION >= 7
>      if (gps_read (&gpsdata, gpsdMessage, gpsdMessageLen) == -1) {
> #else
>      if (gps_read (&gpsdata) == -1) {
> #endif
>      } else {
> 
>        used  = gpsdata.satellites_used;
>        visible = gpsdata.satellites_visible;
>        int i; double snr_total=0;
>        for(i=0;i<visible;i++) {
>            if (gpsdata.skyview[i].used > 0 && gpsdata.skyview[i].ss >
> 1) { snr_total+=gpsdata.skyview[i].ss;
>            }
>        }
>        gps_close (&gpsdata);
> 
> The full program is here:
>    https://www.satsignal.eu/raspberry-pi/monitoring.html#gps

a) fix the incorrect GPS_JSON_RESPONSE_MAX
b) fix it by includeing the proper header file.
c) reply with a copy of you build log.
d) make sure the build log contains your full build commands.

> I'm unsure where the program is getting gps.h from,

From the standard gcc locations.  Plus any "-I" you added.

> but all three
> gps.h I can find are today's date and time, so I hope up-to-date.

You should only ever have ONE copy installed in the system.  It is
OK to have private copies in the build tree, as long as you do not
use them to compile this.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpe1wwlJn2ch.pgp
Description: OpenPGP digital signature


reply via email to

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