summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-18 02:26:27 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-18 02:26:27 +0000
commitbd2cd7dc05b3562d661ae96c0a21b5f257e8d51b (patch)
treedb50c1889588afdda54a819bfbee78cd8d1e6779
parent767de0c9872f22adf1e0c3f78ab783acd82bb1bb (diff)
downloadgpsd-bd2cd7dc05b3562d661ae96c0a21b5f257e8d51b.tar.gz
Document an advantage of the new protocol.
-rw-r--r--gpsd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gpsd.c b/gpsd.c
index 8cc72d44..eb381538 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -658,6 +658,7 @@ static /*@null@*/ struct gps_device_t *open_device(char *device_name)
found:
gpsd_init(devp, &context, device_name);
devp->gpsdata.raw_hook = raw_hook;
+#ifdef OLDSTYLE_ENABLE
/*
* Bring the device all the way so we'll sniff packets from it and
* discover up front what its device class is (e.g GPS, RTCM[23], AIS).
@@ -666,6 +667,14 @@ found:
*/
if (gpsd_activate(devp, true) < 0)
return NULL;
+#else
+ /*
+ * If we're running new protocol only there's no 'g' command
+ * and thus we don't need to know device classes in advance.
+ */
+ if (gpsd_activate(devp, false) < 0)
+ return NULL;
+#endif /* OLDSTYLE_ENABLE */
FD_SET(devp->gpsdata.gps_fd, &all_fds);
adjust_max_fd(devp->gpsdata.gps_fd, true);
return devp;