From 667eedeb2f318ea4213a426cf2f2803ee400c0a3 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Sun, 8 Jul 2012 19:45:35 -0500 Subject: [PATCH] Adding baudrates: 1000000, 11520000, 2000000, 2500000, 3000000, 3500000, and 4000000 to the unix.cc implementation. This is an attempting to work around issue #18, needs testing on a non-USB serial adapter that can handle higher baudrates. --- src/impl/unix.cc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/impl/unix.cc b/src/impl/unix.cc index c43e9ba..48b97a3 100755 --- a/src/impl/unix.cc +++ b/src/impl/unix.cc @@ -211,6 +211,30 @@ Serial::SerialImpl::reconfigurePort () #endif #ifdef B921600 case 921600: baud = B921600; break; +#endif +#ifdef B1000000 + case 1000000: baud = B1000000; break; +#endif +#ifdef B1152000 + case 1152000: baud = B1152000; break; +#endif +#ifdef B1500000 + case 1500000: baud = B1500000; break; +#endif +#ifdef B2000000 + case 2000000: baud = B2000000; break; +#endif +#ifdef B2500000 + case 2500000: baud = B2500000; break; +#endif +#ifdef B3000000 + case 3000000: baud = B3000000; break; +#endif +#ifdef B3500000 + case 3500000: baud = B3500000; break; +#endif +#ifdef B4000000 + case 4000000: baud = B4000000; break; #endif default: custom_baud = true; @@ -222,7 +246,7 @@ Serial::SerialImpl::reconfigurePort () THROW (IOException, errno); } // Linux Support -#elif defined(__linux__) +#elif defined(__linux__) && defined (TIOCSSERIAL) struct serial_struct ser; ioctl (fd_, TIOCGSERIAL, &ser); // set custom divisor