summaryrefslogtreecommitdiff
path: root/net_dgpsip.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-02-24 11:47:19 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-02-24 11:47:19 -0500
commit25fb04476ddb433a108121f74f356e76e44a6a95 (patch)
tree69577707141e703513387735ebd9da35c55cdad5 /net_dgpsip.c
parent6b3fd224e1e2d2e6f086924a6148712a4a445a2c (diff)
downloadgpsd-25fb04476ddb433a108121f74f356e76e44a6a95.tar.gz
Eliminate the context->netgnss_service member.
This is more global context that really needed to be per-device state. Instead, create a per-devicd servicetype member to carry this information. Practically apeaking, this means gpsd can now watch multiple NTRIP and DGPS sessions without getting confused. All regressuin tests pass.
Diffstat (limited to 'net_dgpsip.c')
-rw-r--r--net_dgpsip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net_dgpsip.c b/net_dgpsip.c
index 665f76e7..c747626a 100644
--- a/net_dgpsip.c
+++ b/net_dgpsip.c
@@ -42,9 +42,7 @@ int dgpsip_open(struct gps_device_t *device, const char *dgpsserver)
/* greeting required by some RTCM104 servers; others will ignore it */
(void)snprintf(buf, sizeof(buf), "HELO %s gpsd %s\r\nR\r\n", hn,
VERSION);
- if (write(device->gpsdata.gps_fd, buf, strlen(buf)) == (ssize_t) strlen(buf))
- device->context->netgnss_service = netgnss_dgpsip;
- else
+ if (write(device->gpsdata.gps_fd, buf, strlen(buf)) != (ssize_t) strlen(buf))
gpsd_report(LOG_ERROR, "hello to DGPS server %s failed\n",
dgpsserver);
} else
@@ -55,6 +53,7 @@ int dgpsip_open(struct gps_device_t *device, const char *dgpsserver)
if (opts >= 0)
(void)fcntl(device->gpsdata.gps_fd, F_SETFL, opts | O_NONBLOCK);
+ device->servicetype = service_dgpsip;
return device->gpsdata.gps_fd;
}