28#include <boost/asio.hpp>
29#include <boost/bind.hpp>
30#include <boost/system/system_error.hpp>
39 bool read(
unsigned char &receive_data);
41 void time_out(
const boost::system::error_code &error);
42 void read_complete(
bool &read_error,
const boost::system::error_code &error,
43 size_t bytes_transferred);
45 bool write(
unsigned char &data);
46 bool write(
const std::vector<uint8_t> &data);
53 std::unique_ptr<boost::asio::deadline_timer>
timer;
Serial(std::string device_name, unsigned int baud_rate)
Definition serial.cpp:30
std::string device_name
Definition serial.hpp:49
bool connect()
Definition serial.cpp:42
std::unique_ptr< boost::asio::serial_port > serial_port
Definition serial.hpp:52
std::unique_ptr< boost::asio::io_service > io_service
Definition serial.hpp:51
std::unique_ptr< boost::asio::deadline_timer > timer
Definition serial.hpp:53
bool read_with_timeout(unsigned char &receive_data, int timeout=3)
Definition serial.cpp:98
bool write(unsigned char &data)
Definition serial.cpp:131
bool read(unsigned char &receive_data)
Definition serial.cpp:76
void time_out(const boost::system::error_code &error)
Definition serial.cpp:89
void read_complete(bool &read_error, const boost::system::error_code &error, size_t bytes_transferred)
Definition serial.cpp:81
unsigned int baud_rate
Definition serial.hpp:50