38 #ifndef ASYNC_COMM_SERIAL_H 39 #define ASYNC_COMM_SERIAL_H 43 #include <boost/asio.hpp> 44 #include <boost/function.hpp> 63 Serial(std::string port,
unsigned int baud_rate);
78 void do_async_read(
const boost::asio::mutable_buffers_1 &buffer,
79 boost::function<
void(
const boost::system::error_code&,
size_t)> handler)
override;
81 boost::function<
void(
const boost::system::error_code&,
size_t)> handler)
override;
91 #endif // ASYNC_COMM_SERIAL_H Asynchronous communication class for a serial port.
void do_async_read(const boost::asio::mutable_buffers_1 &buffer, boost::function< void(const boost::system::error_code &, size_t)> handler) override
Abstract base class for an asynchronous communication port.
void do_async_write(const boost::asio::const_buffers_1 &buffer, boost::function< void(const boost::system::error_code &, size_t)> handler) override
Serial(std::string port, unsigned int baud_rate)
Open a serial port.
boost::asio::serial_port serial_port_
bool set_baud_rate(unsigned int baud_rate)
Set serial port baud rate.