Skip to content

Commit

Permalink
Adding baudrates: 1000000, 11520000, 2000000, 2500000, 3000000, 35000…
Browse files Browse the repository at this point in the history
…00, and 4000000 to the unix.cc implementation. This is an attempting to work around issue wjwwood#18, needs testing on a non-USB serial adapter that can handle higher baudrates.
  • Loading branch information
wjwwood committed Jul 9, 2012
1 parent 8a4a9a7 commit 667eede
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/impl/unix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 667eede

Please sign in to comment.