I am using Boost's ASIO class for serial communication. I would like to run it at a 1M baud rate on an OS X system. Whenever I try to set the baud rate to a standard value above 115200, I get an exception.
boost::asio::serial_port m_port;
baudrate = 1000000;
try {
m_port.open(serial_port_path);
} catch (boost::system::system_error::exception e) {
// ...
}
try {
m_port.set_option(boost::asio::serial_port_base::baud_rate(baudrate));
} catch (boost::system::system_error::exception e) {
// Tripped here on OS X
}
I am running OS X (Yosemite) and I installed Boost through home brew. I tested my code on a linux virtual machine (running on top of my OS X system) and it works fine.
Is there a way to make Boost support higher baud rates in OS X?