summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-02-19 10:39:22 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-02-19 10:39:22 +0000
commit3dce54f3ede7d3ba770cd057ba69ea8042cd154d (patch)
tree201f4ebccacda068f38568d3552fcffb44817c32
parentd4ae4ecd38c1fcf323f10097bc780d1505425ff5 (diff)
downloadgpsd-3dce54f3ede7d3ba770cd057ba69ea8042cd154d.tar.gz
Some gpsmon enhancements.
-rw-r--r--gpsmon.c5
-rw-r--r--gpsmon.xml34
-rw-r--r--monitor_proto.c3
3 files changed, 28 insertions, 14 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 935041a5..b0c883c2 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -606,7 +606,10 @@ int main (int argc, char **argv)
if (active == NULL)
monitor_complain("No GPS type detected.");
else {
- context.readonly = false;
+ if (strcspn(line, "01") == strlen(line))
+ context.readonly = !context.readonly;
+ else
+ context.readonly = (atoi(line+1) == 0);
(void)gpsd_switch_driver(&session,
(*active)->driver->type_name);
}
diff --git a/gpsmon.xml b/gpsmon.xml
index a7f1d84a..86e58dab 100644
--- a/gpsmon.xml
+++ b/gpsmon.xml
@@ -91,23 +91,29 @@ in the SiRF firmware.</para>
<varlistentry>
<term>i</term>
<listitem>
-<para>Probe subtype. In normal operation,
-<application>gpsmon</application> does not send configuration strings
-to the device (except for wakeup strings needed to get it to send
-data, if any). This command causes it to send the same sequence of
-subtype probes that <application>gpsd</application> would. This might
-flip the device into another mode; in particular, it will flip a
-SiRF chip into binary mode as if you had used the <quote>n</quote> command.</para>
-<para></para>
+<para>Enable/disable subtype probing and reinitialize the driver. In
+normal operation, <application>gpsmon</application> does not send
+configuration strings to the device (except for wakeup strings needed
+to get it to send data, if any). The command 'i1' causes it to send
+the same sequence of subtype probes that
+<application>gpsd</application> would. The command 'i0' turns off
+probing; 'i' alone toggles the bit. In either case, the current driver
+is re-selected; if the probe bit is enabled, probes will begin to be
+issued immediately.</para>
+
+<para>Note that enabling probing might flip the device into another
+mode; in particular, it will flip a SiRF chip into binary mode as if
+you had used the <quote>n</quote> command. This is due to a
+limitation in the SiRF firmware that we can't fix.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>n</term>
<listitem>
-<para>With an argument of 0, switch device to NMEA mode at current
-speed; with an argument of 1, change to binary (native) mode. Will
-show an error if the device doesn't have such modes.</para>
-<para></para>
+<para>With an argument of 0, switch device to NMEA mode at current
+speed; with an argument of 1, change to binary (native) mode. With no
+argument, toggle the setting. Will show an error if the device doesn't
+have such modes.</para> <para></para>
</listitem>
</varlistentry>
<varlistentry>
@@ -206,7 +212,9 @@ mode.
-->
<para>This tool used to be called 'sirfmon', and worked only on SiRF
devices. It now has support for generic NMEA devices;
-support for other device types is a work in progress,</para>
+support for other device types is a work in progress. It will behave
+sanely, just dumping packets, when connected to a GPS type it knows
+nothing about.</para>
</refsect1>
<refsect1 id='see_also'><title>SEE ALSO</title>
diff --git a/monitor_proto.c b/monitor_proto.c
index 7d887553..439e780d 100644
--- a/monitor_proto.c
+++ b/monitor_proto.c
@@ -82,6 +82,9 @@ static int PROTO_command(char line[])
* he/she presses enter the command line will be passed to this function
* for interpretation. Note: packet receipt is suspended while this
* function is executing.
+ *
+ * This method is optional. If you set the command method pointer to
+ * NULL, gpsmon will behave sanely, accepting no device-specific commands.
*/
/*