diff options
author | Gary E. Miller <gem@rellim.com> | 2019-01-18 16:07:24 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-01-18 16:07:24 -0800 |
commit | 05affb77faf1bf71e15b4a11b35df80f42a9b639 (patch) | |
tree | a37f6f5be68406fd8f05f66132b0af0ea3cffb86 /driver_sirf.c | |
parent | ee22fa1d1defe8c69ebe2cb9a8aa1a2cf0d8b81d (diff) | |
download | gpsd-05affb77faf1bf71e15b4a11b35df80f42a9b639.tar.gz |
driver_sirf: Obey the -b (readonly) flag.
Diffstat (limited to 'driver_sirf.c')
-rw-r--r-- | driver_sirf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/driver_sirf.c b/driver_sirf.c index 5b701975..9fb82a38 100644 --- a/driver_sirf.c +++ b/driver_sirf.c @@ -244,6 +244,10 @@ static bool sirf_write(struct gps_device_t *session, unsigned char *msg) bool ok; unsigned int type = (unsigned int)msg[4]; + /* do not write if -b (readonly) option set */ + if (session->context->readonly) + return true; + /* * Control strings spaced too closely together confuse the SiRF * IV. This wasn't an issue on older SiRFs, but they've gone to a @@ -274,10 +278,11 @@ static bool sirf_write(struct gps_device_t *session, unsigned char *msg) gpsd_log(&session->context->errout, LOG_PROG, "SiRF: Writing MID %#02x:\n", type); - ok = (gpsd_write(session, (const char *)msg, len+8) == (ssize_t) (len+8)); + ok = (gpsd_write(session, (const char *)msg, len + 8) == + (ssize_t) (len + 8)); session->driver.sirf.need_ack = type; - return (ok); + return ok; } #ifdef CONTROLSEND_ENABLE |