diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-10-23 01:33:16 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-10-23 01:33:16 -0400 |
commit | 67fcf237d2f47033f89786632ac389c413b087cd (patch) | |
tree | 65dd8ef60d58fe47378d8f5b97ff951288bb577d /serial.c | |
parent | 223cb81fcfbef632679f9142dfedd02b620fd2c4 (diff) | |
download | gpsd-67fcf237d2f47033f89786632ac389c413b087cd.tar.gz |
Attempted fix for Savannah bug #34562: error in json encoded device list.
Diffstat (limited to 'serial.c')
-rw-r--r-- | serial.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |