summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-10-23 01:33:16 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-10-23 01:33:16 -0400
commit67fcf237d2f47033f89786632ac389c413b087cd (patch)
tree65dd8ef60d58fe47378d8f5b97ff951288bb577d
parent223cb81fcfbef632679f9142dfedd02b620fd2c4 (diff)
downloadgpsd-67fcf237d2f47033f89786632ac389c413b087cd.tar.gz
Attempted fix for Savannah bug #34562: error in json encoded device list.
-rw-r--r--serial.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/serial.c b/serial.c
index d7177d67..1f5f0569 100644
--- a/serial.c
+++ b/serial.c
@@ -458,8 +458,14 @@ int gpsd_serial_open(struct gps_device_t *session)
* Tip from Chris Kuethe: the FIDI chip used in the Trip-Nav
* 200 (and possibly other USB GPSes) gets completely hosed
* in the presence of flow control. Thus, turn off CRTSCTS.
+ *
+ * This is not ideal. Setting no parity here will mean extra
+ * initialization time for some devices, like certain Trimble
+ * boards, that want 7O2 or other non-8N1 settings. But starting
+ * the hunt loop at 8N1 will minimize the average sync time
+ * over all devices.
*/
- session->ttyset.c_cflag &= ~(PARENB | PARODD | CRTSCTS);
+ session->ttyset.c_cflag &= ~(PARENB | PARODD | CRTSCTS | CSTOPB);
session->ttyset.c_cflag |= CREAD | CLOCAL;
session->ttyset.c_iflag = session->ttyset.c_oflag =
session->ttyset.c_lflag = (tcflag_t) 0;
@@ -468,6 +474,8 @@ int gpsd_serial_open(struct gps_device_t *session)
session->baudindex = 0;
#endif /* FIXED_PORT_SPEED */
gpsd_set_speed(session, gpsd_get_speed(&session->ttyset_old), 'N', 1);
+ session->gpsdata.dev.parity = 'N';
+ session->gpsdata.dev.stopbits = 1;
}
gpsd_report(LOG_SPIN, "open(%s) -> %d in gpsd_serial_open()\n",
session->gpsdata.dev.path, session->gpsdata.gps_fd);