diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-02-23 08:48:40 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-02-23 08:48:40 +0000 |
commit | eb57c4a4537bcf6e9055ecfa32272cea1c388760 (patch) | |
tree | 3867b16ed9c632b3378c89b25a3c9c2b148d4e21 /serial.c | |
parent | c741a5c443aee09dc1e08200d0d9a519ab65f35a (diff) | |
download | gpsd-eb57c4a4537bcf6e9055ecfa32272cea1c388760.tar.gz |
Factor out sync after write.
Diffstat (limited to 'serial.c')
-rw-r--r-- | serial.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -122,6 +122,22 @@ int gpsd_open(int device_speed, int stopbits, struct gps_session_t *session) return session->gNMEAdata.gps_fd; } +#ifdef UNRELIABLE_SYNC +void gpsd_drain(int ttyfd) +{ + tcdrain(ttyfd); + /* + * This definitely fails below 40 milliseconds on a BU-303b. + * 50ms is also verified by Chris Kuethe on + * Pharos iGPS360 + GSW 2.3.1ES + prolific + * Rayming TN-200 + GSW 2.3.1 + ftdi + * Rayming TN-200 + GSW 2.3.2 + ftdi + * so it looks pretty solid. + */ + usleep(50000); +} +#endif /* UNRELIABLE_SYNC */ + void gpsd_close(struct gps_session_t *session) { if (session->gNMEAdata.gps_fd != -1) { |