summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rwxr-xr-xregress-driver2
-rw-r--r--serial.c13
3 files changed, 13 insertions, 7 deletions
diff --git a/TODO b/TODO
index 52cc888a..933853be 100644
--- a/TODO
+++ b/TODO
@@ -37,11 +37,6 @@ of mode switch we should be uttering.
*** Cleanup after the big protocol rewrite
-**** ?DEVICE testing
-
-The ?DEVICE invocations corresponding to old B, C, and N still need
-testing on live devices.
-
**** The Python client library presently speaks only old protocol.
**** gpsmon's client mode still relies on old protocol
diff --git a/regress-driver b/regress-driver
index ab042e15..c9a12b73 100755
--- a/regress-driver
+++ b/regress-driver
@@ -73,7 +73,7 @@ case $mode in
echo "Testing super-raw mode..." >&2
for f in $*; do
dir=`dirname $f`
- gpsfake -s 38400 -1 -b -p -r '{"class":"WATCH","enable":False,"raw":1}' $opts ${f} \
+ gpsfake -s 38400 -1 -b -p -r '{"class":"WATCH","enable":False,"raw":2}' $opts ${f} \
| ./striplog -1 >$dir/test1.chk;
./striplog <$${f} >$dir/test2.chk;
cmp $dir/test[12].chk;
diff --git a/serial.c b/serial.c
index b2d93b10..740f6628 100644
--- a/serial.c
+++ b/serial.c
@@ -85,6 +85,11 @@ void gpsd_set_speed(struct gps_device_t *session,
{
speed_t rate;
+ /*
+ * Yes, you can set speeds that aren't in the hunt loop. If you
+ * do this, and you aren't on Linux where boad rate is preserved
+ * across port closings, you've screwed yourself. Don't do that!
+ */
if (speed < 300)
rate = B0;
else if (speed < 1200)
@@ -110,7 +115,13 @@ void gpsd_set_speed(struct gps_device_t *session,
/*
* Don't mess with this conditional! Speed zero is supposed to mean
- * to leave the port speed at whatever it currently is.
+ * to leave the port speed at whatever it currently is. This leads
+ * to excellent behavior on Linux, which preserves baudrate across
+ * serial device closes - it means that if you've opended this
+ * device before you typically don't have to hunt at all because
+ * it's still at the same speed you left it - you'll typically
+ * get packet lock within 1.5 seconds. Alas, the BSDs and OS X
+ * aren't so nice.
*/
/*@ignore@*/
if (rate != B0) {