summaryrefslogtreecommitdiff
path: root/driver_ubx.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-06-15 20:29:03 -0700
committerGary E. Miller <gem@rellim.com>2018-06-15 20:29:03 -0700
commit648ccd2a9d3eb2fa2f88f2116a84b2e5ac6278b1 (patch)
tree3bb5ca9bbb8ffcfce7121e8a9d75053dacaff75b /driver_ubx.c
parent036b05bd375606b9b02c489fb656175f41d03e22 (diff)
downloadgpsd-648ccd2a9d3eb2fa2f88f2116a84b2e5ac6278b1.tar.gz
u-blox: repect the often ignored readonly (-b) flag.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r--driver_ubx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/driver_ubx.c b/driver_ubx.c
index 6f9e2396..d9791c30 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -855,6 +855,10 @@ bool ubx_write(struct gps_device_t * session,
size_t i;
bool ok;
+ /* do not write if -b (readonly) option set */
+ if (session->context->readonly)
+ return true;
+
session->msgbuf[0] = 0xb5;
session->msgbuf[1] = 0x62;