summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-09-06 22:59:21 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-09-06 22:59:21 +0000
commita29b1288b7e848f3ab9b66a70e78df71b585b01b (patch)
treeac04fb76ef74e0d7d0bdd68f04820021ff50889d
parent4dec37dccd92b71d1903535235ab2f2fb450e4ef (diff)
downloadgpsd-a29b1288b7e848f3ab9b66a70e78df71b585b01b.tar.gz
xgps now has the -l option as well as cgps. Document it.
-rw-r--r--AUTHORS3
-rw-r--r--cgps.c15
-rw-r--r--gpsd.spec.in4
-rw-r--r--www/index.html.in2
-rw-r--r--xgps.17
-rw-r--r--xgps.c36
-rw-r--r--xgps.xml7
7 files changed, 53 insertions, 21 deletions
diff --git a/AUTHORS b/AUTHORS
index 6381503b..c09ed7bb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,4 +2,5 @@ Remco Treffkorn <remco@rvt.com>
Derrick J. Brashear <shadow@dementia.org>
Russ Nelson <nelson@crynwyr.com>
Eric S. Raymond <esr@thyrsus.com>
-
+Gary E. Miller <gem@rellim.com>
+Jeff Francis <jeff@gritch.org>
diff --git a/cgps.c b/cgps.c
index 6a2a9b14..68150ee0 100644
--- a/cgps.c
+++ b/cgps.c
@@ -244,25 +244,24 @@ int main(int argc, char *argv[])
case 'V':
(void)fprintf(stderr, "SVN ID: $Id$ \n");
exit(0);
- case 'h': default:
- usage( argv[0] );
- break;
case 'l':
switch ( optarg[0] ) {
case 'd':
deg_type = deg_dd;
- break;
+ continue;
case 'm':
deg_type = deg_ddmm;
- break;
+ continue;
case 's':
deg_type = deg_ddmmss;
- break;
+ continue;
default:
(void)fprintf(stderr, "Unknown -l argument: %s\n", optarg);
- usage( argv[0] );
- break;
+ /*@ -casebreak @*/
}
+ case 'h': default:
+ usage(argv[0]);
+ break;
}
}
diff --git a/gpsd.spec.in b/gpsd.spec.in
index dc9156cf..e1c20edb 100644
--- a/gpsd.spec.in
+++ b/gpsd.spec.in
@@ -141,7 +141,9 @@ cp gps.py gpsfake.py "$RPM_BUILD_ROOT"%{_libdir}/python${PYVERSION}/site-package
%changelog
* Sat Aug 20 2005 Eric S. Raymond <esr@snark.thyrsus.com> - @VERSION@-1
-- Prevent core dump on -d option.
+- Prevent core dump on -d option. The .log option is no longer required for
+ test loads. cgps and xgps now have configurable latitude/longitude formats
+ via the -l option.
* Fri Aug 19 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.29-1
- Added Sony CXD2951 support, untested. All error estimates are
diff --git a/www/index.html.in b/www/index.html.in
index 706f1404..7a2cd343 100644
--- a/www/index.html.in
+++ b/www/index.html.in
@@ -219,6 +219,8 @@ script</a>.</p>
<p>You can find Debian-stable packages
<a href='http://packages.debian.org/unstable/misc/gpsd'>here</a>.</p>
+<p><code>gpsd</code> is carried in the OpenBSD ports tree.</p>
+
<p>The penguin-with-satellites logo is a hacked version of one I found
<a
href='http://www.gfz-potsdam.de/pb1/staff/gbeyerle/opengps/'>here</a>.
diff --git a/xgps.1 b/xgps.1
index a31267db..5683ecc4 100644
--- a/xgps.1
+++ b/xgps.1
@@ -24,7 +24,7 @@ xgps, xgpsspeed, cgps \- test clients for gpsd
.ad l
.hy 0
.HP 5
-\fBxgps\fR [\fIX\-options\fR] [\-h] [\-v] [\-speedunits\ {\fBmph\fR\ |\ \fBkph\fR\ |\ \fBknots\fR}] [\-altunits\ {\fBfeet\fR\ |\ \fBmeters\fR}] [\fIserver\fR [\fI:port\fR [\fI:device\fR]]]
+\fBxgps\fR [\fIX\-options\fR] [\-h] [\-v] [\-speedunits\ {\fBmph\fR\ |\ \fBkph\fR\ |\ \fBknots\fR}] [\-altunits\ {\fBfeet\fR\ |\ \fBmeters\fR}] [\-l\ [\fBd\fR\ |\ \fBm\fR\ |\ \fBs\fR]] [\fIserver\fR [\fI:port\fR [\fI:device\fR]]]
.ad
.hy
.ad l
@@ -36,7 +36,7 @@ xgps, xgpsspeed, cgps \- test clients for gpsd
.ad l
.hy 0
.HP 5
-\fBcgps\fR [\-h] [\-v] [\-speedunits\ {\fBmph\fR\ |\ \fBkph\fR\ |\ \fBknots\fR}] [\-altunits\ {\fBfeet\fR\ |\ \fBmeters\fR}] [\fIserver\fR [\fI:port\fR [\fI:device\fR]]]
+\fBcgps\fR [\-h] [\-v] [\-speedunits\ {\fBmph\fR\ |\ \fBkph\fR\ |\ \fBknots\fR}] [\-altunits\ {\fBfeet\fR\ |\ \fBmeters\fR}] [\-l\ [\fBd\fR\ |\ \fBm\fR\ |\ \fBs\fR]] [\fIserver\fR [\fI:port\fR [\fI:device\fR]]]
.ad
.hy
@@ -60,6 +60,9 @@ The \fB\-speedunits\fR option can be used to set the speed units for display; fo
The \fB\-altunits\fR option can be used to set the altitude units for display; follow the keyword with 'meters' or 'feet'\&. The default is feet\&. This option can also be set as the X resource 'altunits'\&.
.PP
+The \fB\-l\fR option sets the format of latitude and longitude reports\&. The value 'd' produces decimal degrees and is the default\&. The value 'm' produces degrees and decimal minutes\&. The value 's' produces degrees, minutes, and decimal seconds\&.
+
+.PP
There is a known bug in xgps; it assumes the default font size is no more than 18 pixels\&. If this is not the case, the satellite data display will show fewer than 12 satellites\&.
.SS "xgpsspeed"
diff --git a/xgps.c b/xgps.c
index 0feb1c32..0a7d0d93 100644
--- a/xgps.c
+++ b/xgps.c
@@ -246,6 +246,7 @@ static time_t timer; /* time of last state change */
static int state = 0; /* or MODE_NO_FIX=1, MODE_2D=2, MODE_3D=3 */
static XtAppContext app;
static XtIntervalId timeout;
+static enum deg_str_type deg_type = deg_dd;
static void handle_input(XtPointer client_data UNUSED, int *source UNUSED,
XtInputId *id UNUSED)
@@ -264,7 +265,7 @@ static void update_panel(struct gps_data_t *gpsdata,
unsigned int i;
int newstate;
XmString string[MAXCHANNELS+1];
- char s[128], *sp;
+ char s[128], *latlon, *sp;
if (message[0] != '\0')
while (isspace(*(sp = message + strlen(message) - 1)))
@@ -294,14 +295,16 @@ static void update_panel(struct gps_data_t *gpsdata,
else
(void)strcpy(s, "n/a");
XmTextFieldSetString(text_1, s);
- if (gpsdata->fix.mode >= MODE_2D)
- (void)snprintf(s, sizeof(s), "%lf %c", fabs(gpsdata->fix.latitude), (gpsdata->fix.latitude < 0) ? 'S' : 'N');
- else
+ if (gpsdata->fix.mode >= MODE_2D) {
+ latlon = deg_to_str(deg_type, fabs(gpsdata->fix.latitude));
+ (void)snprintf(s, sizeof(s), "%s %c", latlon, (gpsdata->fix.latitude < 0) ? 'S' : 'N');
+ } else
(void)strcpy(s, "n/a");
XmTextFieldSetString(text_2, s);
- if (gpsdata->fix.mode >= MODE_2D)
- (void)snprintf(s, sizeof(s), "%lf %c", fabs(gpsdata->fix.longitude), (gpsdata->fix.longitude < 0) ? 'W' : 'E');
- else
+ if (gpsdata->fix.mode >= MODE_2D) {
+ latlon = deg_to_str(deg_type, fabs(gpsdata->fix.longitude));
+ (void)snprintf(s, sizeof(s), "%s %c", latlon, (gpsdata->fix.longitude < 0) ? 'W' : 'E');
+ } else
(void)strcpy(s, "n/a");
XmTextFieldSetString(text_3, s);
if (gpsdata->fix.mode == MODE_3D)
@@ -418,13 +421,28 @@ speedunits_ok:;
(void)fprintf(stderr, "xgps: unknown altitude unit, defaulting to %s\n", altunits->legend);
altunits_ok:;
- while ((option = getopt(argc, argv, "hv")) != -1) {
+ while ((option = getopt(argc, argv, "hl:v")) != -1) {
switch (option) {
case 'v':
(void)printf("xgps %s\n", VERSION);
exit(0);
+ case 'l':
+ switch ( optarg[0] ) {
+ case 'd':
+ deg_type = deg_dd;
+ continue;
+ case 'm':
+ deg_type = deg_ddmm;
+ continue;
+ case 's':
+ deg_type = deg_ddmmss;
+ continue;
+ default:
+ (void)fprintf(stderr, "Unknown -l argument: %s\n", optarg);
+ /*@ -casebreak @*/
+ }
case 'h': default:
- (void)fputs("usage: xgps [-hv] [-speedunits {mph,kph,knots}] [-altunits {ft,meters}] [server[:port:[device]]]\n", stderr);
+ (void)fputs("usage: xgps [-hv] [-speedunits {mph,kph,knots}] [-altunits {ft,meters}] [-l {d|m|s}] [server[:port:[device]]]\n", stderr);
exit(1);
}
}
diff --git a/xgps.xml b/xgps.xml
index 7f7327f6..139bfb49 100644
--- a/xgps.xml
+++ b/xgps.xml
@@ -23,6 +23,7 @@
<arg choice='opt'>-v </arg>
<arg choice='opt'>-speedunits <group choice='req'><arg>mph</arg><arg>kph</arg><arg>knots</arg></group></arg>
<arg choice='opt'>-altunits <group choice='req'><arg>feet</arg><arg>meters</arg></group></arg>
+ <arg choice='opt'>-l <group><arg>d</arg><arg>m</arg><arg>s</arg></group></arg>
<group>
<replaceable>server</replaceable>
<group>
@@ -53,6 +54,7 @@
<arg choice='opt'>-v </arg>
<arg choice='opt'>-speedunits <group choice='req'><arg>mph</arg><arg>kph</arg><arg>knots</arg></group></arg>
<arg choice='opt'>-altunits <group choice='req'><arg>feet</arg><arg>meters</arg></group></arg>
+ <arg choice='opt'>-l <group><arg>d</arg><arg>m</arg><arg>s</arg></group></arg>
<group>
<replaceable>server</replaceable>
<group>
@@ -93,6 +95,11 @@ altitude units for display; follow the keyword with 'meters' or
'feet'. The default is feet. This option can also be set as the X
resource 'altunits'.</para>
+<para> The <option>-l</option> option sets the format of latitude and
+longitude reports. The value 'd' produces decimal degrees and is the
+default. The value 'm' produces degrees and decimal minutes. The
+value 's' produces degrees, minutes, and decimal seconds.</para>
+
<para>There is a known bug in <application>xgps</application>; it
assumes the default font size is no more than 18 pixels. If this
is not the case, the satellite data display will show fewer than