diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-02-03 06:49:09 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-03 06:49:09 -0500 |
commit | 49e4973241842e690a6189ba02166c05e07aa796 (patch) | |
tree | bed5095337a3e076ce17c88d9cdd5b2d3cf9e03e /libgps_json.c | |
parent | 15da79366ba2ece526ca03e6e2f9c934d850989e (diff) | |
download | gpsd-49e4973241842e690a6189ba02166c05e07aa796.tar.gz |
Compute satellites_visible in the client-side JSON parser.
Diffstat (limited to 'libgps_json.c')
-rw-r--r-- | libgps_json.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libgps_json.c b/libgps_json.c index fbce7f19..aec7f3b7 100644 --- a/libgps_json.c +++ b/libgps_json.c @@ -233,7 +233,10 @@ static int json_sky_read(const char *buf, struct gps_data_t *gpsdata, gpsdata->skyview_time = iso8601_to_unix(tbuf); /*@+usedef@*/ gpsdata->satellites_used = 0; + gpsdata->satellites_visible = 0; for (i = j = 0; i < MAXCHANNELS; i++) { + if(gpsdata->PRN[i] > 0) + gpsdata->satellites_visible++; if (usedflags[i]) { gpsdata->used[j++] = gpsdata->PRN[i]; gpsdata->satellites_used++; |