How to set baud rate & parity on boost::asio::serial_port
This example shows how to baudrate, parity & stop bits:
// Configure serial port parameters: 115.2kBaud, 8N1
serial.set_option(boost::asio::serial_port_base::baud_rate(115200));
serial.set_option(boost::asio::serial_port_base::character_size(8 /* data bits */));
serial.set_option(boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none));
serial.set_option(boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one));
For a more complete example that also shows how to open the serial port, seeĀ How to open & initialize boost::asio::serial_port or ourĀ Minimal boost::asio::serial_port read (read_some) example