Asynchronous communication class for a serial port.
More...
#include <serial.h>
|
void | do_async_read (const boost::asio::mutable_buffers_1 &buffer, boost::function< void(const boost::system::error_code &, size_t)> handler) override |
|
void | do_async_write (const boost::asio::const_buffers_1 &buffer, boost::function< void(const boost::system::error_code &, size_t)> handler) override |
|
void | do_close () override |
|
bool | do_init () override |
|
bool | is_open () override |
|
Asynchronous communication class for a serial port.
Definition at line 55 of file serial.h.
async_comm::Serial::Serial |
( |
std::string |
port, |
|
|
unsigned int |
baud_rate |
|
) |
| |
Open a serial port.
- Parameters
-
port | The port to open (e.g. "/dev/ttyUSB0") |
baud_rate | The baud rate for the serial port (e.g. 115200) |
Definition at line 47 of file serial.cpp.
async_comm::Serial::~Serial |
( |
| ) |
|
void async_comm::Serial::do_async_read |
( |
const boost::asio::mutable_buffers_1 & |
buffer, |
|
|
boost::function< void(const boost::system::error_code &, size_t)> |
handler |
|
) |
| |
|
overrideprivatevirtual |
void async_comm::Serial::do_async_write |
( |
const boost::asio::const_buffers_1 & |
buffer, |
|
|
boost::function< void(const boost::system::error_code &, size_t)> |
handler |
|
) |
| |
|
overrideprivatevirtual |
void async_comm::Serial::do_close |
( |
| ) |
|
|
overrideprivatevirtual |
bool async_comm::Serial::do_init |
( |
| ) |
|
|
overrideprivatevirtual |
bool async_comm::Serial::is_open |
( |
| ) |
|
|
overrideprivatevirtual |
bool async_comm::Serial::set_baud_rate |
( |
unsigned int |
baud_rate | ) |
|
Set serial port baud rate.
- Parameters
-
baud_rate | The baud rate for the serial port (e.g. 115200) |
- Returns
- True if successful
Definition at line 60 of file serial.cpp.
unsigned int async_comm::Serial::baud_rate_ |
|
private |
std::string async_comm::Serial::port_ |
|
private |
boost::asio::serial_port async_comm::Serial::serial_port_ |
|
private |
The documentation for this class was generated from the following files: