summaryrefslogtreecommitdiff
path: root/xgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-30 22:02:09 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-30 22:02:09 +0000
commit768053d2716143a445af839ba5923fca01578c71 (patch)
treed64c0a6b6a2884d6357c442af44fa04d3a2e6f3c /xgps.c
parentf77433d6c53cf31cdb375e11f51c6389169bcbb1 (diff)
downloadgpsd-768053d2716143a445af839ba5923fca01578c71.tar.gz
Implement -j option in xgps. Document it in cgps.
Diffstat (limited to 'xgps.c')
-rw-r--r--xgps.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xgps.c b/xgps.c
index d0cb0c5e..2df3d82a 100644
--- a/xgps.c
+++ b/xgps.c
@@ -431,6 +431,7 @@ static void update_panel(struct gps_data_t *gpsdata,
char *arg = NULL, *colon1, *colon2, *device = NULL, *server = NULL, *port = DEFAULT_GPSD_PORT;
char *su, *au;
char *err_str = NULL;
+ bool jitteropt = false;
/*@ -onlytrans */
toplevel = XtVaAppInitialize(&app, "xgps",
@@ -458,11 +459,14 @@ static void update_panel(struct gps_data_t *gpsdata,
(void)fprintf(stderr, "xgps: unknown altitude unit, defaulting to %s\n", altunits->legend);
altunits_ok:;
- while ((option = getopt(argc, argv, "hl:s:V")) != -1) {
+ while ((option = getopt(argc, argv, "hjl:s:V")) != -1) {
switch (option) {
case 'V':
(void)printf("xgps %s\n", VERSION);
exit(0);
+ case 'j':
+ jitteropt = true;
+ continue;
case 'l':
switch ( optarg[0] ) {
case 'd':
@@ -534,10 +538,13 @@ static void update_panel(struct gps_data_t *gpsdata,
gps_set_raw_hook(gpsdata, update_panel);
+ if (jitteropt)
+ (void)gps_query(gpsdata, "J=1");
+
if (device)
- (void)gps_query(gpsdata, "F=%s\n", device);
+ (void)gps_query(gpsdata, "F=%s", device);
- (void)gps_query(gpsdata, "w+x\n");
+ (void)gps_query(gpsdata, "w+x");
(void)XtAppAddInput(app, gpsdata->gps_fd,
(XtPointer)XtInputReadMask, handle_input, NULL);