summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-11-07 05:49:40 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-11-07 05:49:40 +0000
commit1606f5a96c9212b4376b7550f652710b8d5ccce4 (patch)
tree1c603e42734e29e14d5f5afb85889321c805eed2 /drivers.c
parent98dc21f747265b4339912b23da3985f81d2c89d5 (diff)
downloadgpsd-1606f5a96c9212b4376b7550f652710b8d5ccce4.tar.gz
Make sure none of the trigger strings for NMEA drivers are identical to probes.
This avoids confusion by devices like SiRFs in NMEA that echo unknown probe strings back at us.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers.c b/drivers.c
index 21e01b41..f6780e0b 100644
--- a/drivers.c
+++ b/drivers.c
@@ -118,27 +118,33 @@ static void nmea_probe_subtype(struct gps_device_t *session, int seq)
* later ones won't be sent at all. Thus, for best overall
* performance, order these to probe for the most popular types
* soonest.
+ *
+ * Note: don't make the trigger strings identical to the probe,
+ * because some NMEA devices (notably SiRFs) will just echo
+ * unknown strings right back at you. A useful dodge is to append
+ * a comma to the trigger, because that won't be in the response
+ * unless there is actual following data.
*/
switch (seq) {
#ifdef SIRF_ENABLE
case 0:
- /* probe for SiRF */
+ /* probe for SiRF -- expect $Ack 105. */
(void)nmea_send(session->gpsdata.gps_fd, "$PSRF105,1");
break;
#endif /* SIRF_ENABLE */
#ifdef NMEA_ENABLE
case 1:
- /* probe for Garmin serial GPS */
+ /* probe for Garmin serial GPS -- expect $PGRMC followed by data*/
(void)nmea_send(session->gpsdata.gps_fd, "$PGRMCE");
break;
case 2:
- /* probe for the FV-18 */
+ /* probe for the FV-18 -- expect $PFEC,GPint followed by data */
(void)nmea_send(session->gpsdata.gps_fd, "$PFEC,GPint");
break;
#endif /* NMEA_ENABLE */
#ifdef ITRAX_ENABLE
case 3:
- /* probe for iTrax, looking for "OK" */
+ /* probe for iTrax, looking for "$PFST,OK" */
(void)nmea_send(session->gpsdata.gps_fd, "$PFST");
break;
#endif /* ITRAX_ENABLE */
@@ -215,7 +221,7 @@ static void garmin_nmea_configurator(struct gps_device_t *session)
static struct gps_type_t garmin = {
.typename = "Garmin Serial", /* full name of type */
- .trigger = "$PGRMC", /* Garmin private */
+ .trigger = "$PGRMC,", /* Garmin private */
.channels = 12, /* not used by this driver */
.probe_wakeup = NULL, /* no wakeup to be done before hunt */
.probe_detect = NULL, /* no probe */
@@ -251,7 +257,7 @@ static void fv18_configure(struct gps_device_t *session)
static struct gps_type_t fv18 = {
.typename = "San Jose Navigation FV18", /* full name of type */
- .trigger = "$PFEC,GPint", /* FV18s should echo the probe */
+ .trigger = "$PFEC,GPint,", /* FV18s should echo the probe */
.channels = 12, /* not used by this driver */
.probe_wakeup = NULL, /* no wakeup to be done before hunt */
.probe_detect = NULL, /* mo probe */