43 using boost::asio::serial_port_base;
47 serial_port_(io_service_),
69 serial_port_.set_option(serial_port_base::character_size(8));
70 serial_port_.set_option(serial_port_base::parity(serial_port_base::parity::none));
71 serial_port_.set_option(serial_port_base::stop_bits(serial_port_base::stop_bits::one));
72 serial_port_.set_option(serial_port_base::flow_control(serial_port_base::flow_control::none));
74 catch (boost::system::system_error e)
85 void MavlinkSerial::do_async_read(
const boost::asio::mutable_buffers_1 &buffer, 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.