summaryrefslogtreecommitdiff
path: root/libgps_sock.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-24 10:17:59 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-24 10:17:59 -0400
commit0658c2fb8d15fbe78fdd4edd1be184559ab53c32 (patch)
treeb61f6cc53b9aaf5d0575f93966b18a799861460b /libgps_sock.c
parente18934bf45246408915652f7b6a5e5ce66cccd8a (diff)
downloadgpsd-0658c2fb8d15fbe78fdd4edd1be184559ab53c32.tar.gz
Drop the obsolete tag field from JSON output. Bump the minor protocol number.
Required a regression-test rebuild, of course. The field is still set by the TSIP and SiRF drivers; the SiRF driver actually uses it. It may be possible to eliminate the TSIP uses, but so far attempting this has produced odd regression-test failures.
Diffstat (limited to 'libgps_sock.c')
-rw-r--r--libgps_sock.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libgps_sock.c b/libgps_sock.c
index 015a2f17..2a846a13 100644
--- a/libgps_sock.c
+++ b/libgps_sock.c
@@ -329,14 +329,14 @@ int gps_unpack(char *buf, struct gps_data_t *gpsdata)
gps_clear_fix(&gpsdata->fix);
} else {
struct gps_fix_t nf;
- char tag[MAXTAGLEN + 1], alt[20];
+ char alt[20];
char eph[20], epv[20], track[20], speed[20],
climb[20];
char epd[20], eps[20], epc[20], mode[2];
char timestr[20], ept[20], lat[20], lon[20];
int st = sscanf(sp + 2,
- "%8s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %1s",
- tag, timestr, ept, lat, lon,
+ "%*s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %19s %1s",
+ timestr, ept, lat, lon,
alt, eph, epv, track, speed,
climb,
epd, eps, epc, mode);
@@ -379,8 +379,6 @@ int gps_unpack(char *buf, struct gps_data_t *gpsdata)
if (isnan(nf.epc) == 0)
gpsdata->set |= CLIMBERR_SET;
gpsdata->fix = nf;
- (void)strlcpy(gpsdata->tag, tag,
- MAXTAGLEN + 1);
gpsdata->set |=
TIME_SET | TIMERR_SET | LATLON_SET |
MODE_SET;
@@ -404,13 +402,12 @@ int gps_unpack(char *buf, struct gps_data_t *gpsdata)
} else {
int j, i1, i2, i3, i5;
double f4;
- char tag[MAXTAGLEN + 1], timestamp[21];
+ char timestamp[21];
// cppcheck-suppress invalidscanf
- (void)sscanf(sp, "Y=%8s %20s %d ",
- tag, timestamp,
+ (void)sscanf(sp, "Y=%*s %20s %d ",
+ timestamp,
&gpsdata->satellites_visible);
- (void)strlcpy(gpsdata->tag, tag, MAXTAGLEN);
if (timestamp[0] != '?') {
gpsdata->set |= TIME_SET;
}