42 using boost::asio::serial_port_base;
46 serial_port_(io_service_),
68 serial_port_.set_option(serial_port_base::character_size(8));
69 serial_port_.set_option(serial_port_base::parity(serial_port_base::parity::none));
70 serial_port_.set_option(serial_port_base::stop_bits(serial_port_base::stop_bits::one));
71 serial_port_.set_option(serial_port_base::flow_control(serial_port_base::flow_control::none));
73 catch (boost::system::system_error e)
85 boost::function<
void(
const boost::system::error_code &,
size_t)> handler)
91 boost::function<
void(
const boost::system::error_code &,
size_t)> handler)
virtual void do_async_read(const boost::asio::mutable_buffers_1 &buffer, boost::function< void(const boost::system::error_code &, size_t)> handler)
Initiate an asynchronous read operation.
boost::asio::serial_port serial_port_
boost serial port object
Describes an exception encountered while using the boost serial libraries.
MavlinkSerial(std::string port, int baud_rate)
Instantiates the class and begins communication on the specified serial port.
virtual void do_async_write(const boost::asio::const_buffers_1 &buffer, boost::function< void(const boost::system::error_code &, size_t)> handler)
Initialize an asynchronous write operation.
~MavlinkSerial()
Stops communication and closes the serial port before the object is destroyed.