diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-02-24 09:27:39 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-24 09:27:39 -0500 |
commit | e9f0b59325f6ea938ff8ff892cf181c6d209db9a (patch) | |
tree | 0d8e4f89e0e076ae408550a4fc5064aba6bdf026 /gpsd.h-tail | |
parent | 501c0f83b676eb730fab413da0bf602f8d607710 (diff) | |
download | gpsd-e9f0b59325f6ea938ff8ff892cf181c6d209db9a.tar.gz |
Move NTRIP per-connection state from global context to private driver area.
The flap over probes revealed that the NTRIP support is bolted onto the daemon
in a very awkward way that is likely to cause problems now that it's actually
being, like, *used*. This is a step towards making it behave more like a
normal driver.
Diffstat (limited to 'gpsd.h-tail')
-rw-r--r-- | gpsd.h-tail | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index 3dcb412a..14dedf9c 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -183,15 +183,6 @@ struct gps_context_t { /* DGPSIP status */ bool sentdgps; /* have we sent a DGPS report? */ enum { netgnss_none, netgnss_dgpsip, netgnss_ntrip} netgnss_service; /* type of GNSS service */ - enum { - ntrip_conn_init, - ntrip_conn_sent_probe, - ntrip_conn_sent_get, - ntrip_conn_established, - ntrip_conn_err - } ntrip_conn_state; /* ntrip connection state for multi stage connect */ - bool ntrip_works; /* this marks a working connection, so we try to reconnect once */ - bool ntrip_sourcetable_parse; /* have we read the sourcetable header? */ int fixcnt; /* count of good fixes seen */ socket_t dsock; /* socket to DGPSIP server/Ntrip caster */ size_t rtcmbytes; /* byte count of last RTCM104 report */ @@ -518,6 +509,22 @@ struct gps_device_t { unsigned int bufindex; } isgps; #endif /* BINARY_ENABLE */ + + /* + * State of an NTRIP connection. Havoc will ensue if ntrip_conn_init + * is not 0, as this is initialized by memset(... '\0', ...). + */ + struct { + enum { + ntrip_conn_init, + ntrip_conn_sent_probe, + ntrip_conn_sent_get, + ntrip_conn_established, + ntrip_conn_err + } conn_state; /* connection state for multi stage connect */ + bool works; /* marks a working connection, so we try to reconnect once */ + bool sourcetable_parse; /* have we read the sourcetable header? */ + } ntrip; } driver; /* * Auxiliary structures for parsing data that can be interleaved with |