diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2009-11-17 05:44:40 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2009-11-17 05:44:40 +0000 |
commit | a4e8e39e468561ac9236ff1b1cea64f7395a2c87 (patch) | |
tree | 159d77608323fdd4109816a0b4743d8d020d7586 /driver_tsip.c | |
parent | 824f8a5531cd4524a63d20a7b3d019202f87ca6b (diff) | |
download | gpsd-a4e8e39e468561ac9236ff1b1cea64f7395a2c87.tar.gz |
fix the probe logic, thereby unbreaking the rest of the protocols.
Diffstat (limited to 'driver_tsip.c')
-rw-r--r-- | driver_tsip.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/driver_tsip.c b/driver_tsip.c index b5714f2a..9aa5ad6d 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -71,9 +71,15 @@ static bool tsip_detect(struct gps_device_t *session) int myfd; fd_set fdset; struct timeval to; + speed_t old_baudrate; + char old_parity; + unsigned int old_stopbits; gpsd_report(LOG_PROG, "Probing TSIP\n"); + old_baudrate = session->gpsdata.dev.baudrate; + old_parity = session->gpsdata.dev.parity; + old_stopbits = session->gpsdata.dev.stopbits; gpsd_set_speed(session, 9600, 'O', 1); /* request firmware revision and look for a valid response */ @@ -102,10 +108,7 @@ static bool tsip_detect(struct gps_device_t *session) if (ret == 0) /* return serial port to original settings */ - gpsd_set_speed(session, - session->gpsdata.dev.baudrate, - session->gpsdata.dev.parity, - session->gpsdata.dev.stopbits); + gpsd_set_speed(session, old_baudrate, old_parity, old_stopbits); return ret; } |