mjuenema / python-gpsdshm

Python interface to gpsd's shared memory segment.
BSD 2-Clause "Simplified" License
4 stars 3 forks source link

Fix satellites[x].used #7

Open mjuenema opened 8 years ago

mjuenema commented 8 years ago

The logic seems to have changed between API 5 and 6. In API 5 gps_data.t.used seems to be a list of satellite prn used in the solution. In API 6, gps_data_t.gps_satellite_t.used is a boolean.

mjuenema commented 8 years ago

Relevant code can be found in gpsd-3.9/cgps.c

    /* must build bit vector of which statellites are used from list */
    for (i = 0; i < MAXCHANNELS; i++) {
        usedflags[i] = false;
        for (j = 0; j < gpsdata->satellites_used; j++)
            if (gpsdata->used[j] == gpsdata->PRN[i])
                usedflags[i] = true;
    }

A satellite is used, when its PRN appears in the gpsdata->used[] list.