1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-23 04:04:54 +08:00

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.

This commit is contained in:
William Woodall 2012-07-08 19:45:35 -05:00
parent 8a4a9a78c4
commit 667eedeb2f

View File

@ -211,6 +211,30 @@ Serial::SerialImpl::reconfigurePort ()
#endif #endif
#ifdef B921600 #ifdef B921600
case 921600: baud = B921600; break; 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 #endif
default: default:
custom_baud = true; custom_baud = true;
@ -222,7 +246,7 @@ Serial::SerialImpl::reconfigurePort ()
THROW (IOException, errno); THROW (IOException, errno);
} }
// Linux Support // Linux Support
#elif defined(__linux__) #elif defined(__linux__) && defined (TIOCSSERIAL)
struct serial_struct ser; struct serial_struct ser;
ioctl (fd_, TIOCGSERIAL, &ser); ioctl (fd_, TIOCGSERIAL, &ser);
// set custom divisor // set custom divisor