From 1edc982a12b0aecd033883bf2256f14704e7fa5c Mon Sep 17 00:00:00 2001 From: Kai Harrekilde-Petersen Date: Sun, 18 Mar 2018 12:38:01 +0100 Subject: [PATCH 1/2] On Linux systems, accept/try up to 921600 baud. Signed-off-by: Kai Harrekilde-Petersen --- serial.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/serial.c b/serial.c index 2c171f2..18aa9cd 100644 --- a/serial.c +++ b/serial.c @@ -211,6 +211,12 @@ static speed_t gpsd_get_speed_termios(const struct termios *ttyctl) return (115200); case B230400: return (230400); +#ifdef __linux__ + case B460800: + return (460800); + case B921600: + return (921600); +#endif /* __linux__ */ default: /* B0 */ return 0; } @@ -289,8 +295,15 @@ void gpsd_set_speed(struct gps_device_t *session, rate = B57600; else if (speed < 230400) rate = B115200; +#ifdef __linux__ + else if (speed < 460800) + rate = B230400; + else if (speed < 460800) + rate = B921600; +#else else rate = B230400; +#endif /* __linux__ */ if (rate != cfgetispeed(&session->ttyset) || parity != session->gpsdata.dev.parity @@ -676,7 +689,7 @@ bool gpsd_next_hunt_setting(struct gps_device_t * session) #else /* every rate we're likely to see on a GPS */ static unsigned int rates[] = - { 0, 4800, 9600, 19200, 38400, 57600, 115200, 230400}; + { 0, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600}; if (session->baudindex++ >= (unsigned int)(sizeof(rates) / sizeof(rates[0])) - 1) { -- 2.7.4