diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2006-10-02 19:14:25 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2006-10-02 19:14:25 +0000 |
commit | b21b6d9cc3f8d0d6746c5284c16ff9128b1cdac8 (patch) | |
tree | c9f999f95a275ffc8572ea9cc2787c7c34df1161 /gpsd.c | |
parent | 2ad7643dbb0af1c336db09b6b4f11a8e07984953 (diff) | |
download | gpsd-b21b6d9cc3f8d0d6746c5284c16ff9128b1cdac8.tar.gz |
Introducing a new configuration option "--disable-reconfigure"...
...which is used to prevent gpsd from taking actions which would alter
the configuration of your receiver. This could include, but might not
be limited to:
* port speed
* communication protocol
* output messages sent
* output message rate
* resetting the receiver
* clearing stored almanac/ephemeris/position/clock calibration
This is useful in cases where you have your receiver set up in a particular
manner (logging raw pseudoranges, carrier phases and NAV data, for example)
and don't mind sharing that data, so long as it's read-only.
For now, this affects the speed/protocol switch commands in gpsd.c, but the
device drivers will need to be patched as well.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -625,6 +625,7 @@ static int handle_gpsd_request(int cfd, char *buf, int buflen) if (assign_channel(whoami) && whoami->device->device_type!=NULL && *p=='=' && privileged_user(whoami)) { i = atoi(++p); while (isdigit(*p)) p++; +#ifdef ALLOW_RECONFIGURE if (whoami->device->device_type->speed_switcher) if (whoami->device->device_type->speed_switcher(whoami->device, (unsigned)i)) { /* @@ -649,6 +650,7 @@ static int handle_gpsd_request(int cfd, char *buf, int buflen) whoami->device->gpsdata.stopbits); } } +#endif /* ALLOW_RECONFIGURE */ if (whoami->device) { if ( whoami->device->gpsdata.parity == 0 ) { /* zero parity breaks the next snprintf */ @@ -789,6 +791,7 @@ static int handle_gpsd_request(int cfd, char *buf, int buflen) (void)strlcpy(phrase, ",N=?", BUFSIZ); else if (!whoami->device->device_type->mode_switcher) (void)strlcpy(phrase, ",N=0", BUFSIZ); +#ifdef ALLOW_RECONFIGURE else if (privileged_user(whoami)) { if (*p == '=') ++p; if (*p == '1' || *p == '+') { @@ -799,6 +802,7 @@ static int handle_gpsd_request(int cfd, char *buf, int buflen) p++; } } +#endif /* ALLOW_RECONFIGURE */ if (!whoami->device) (void)snprintf(phrase, sizeof(phrase), ",N=?"); else |