12 #include <boost/asio.hpp> 13 #include <boost/bind.hpp> 14 #include <boost/thread.hpp> 15 #include <boost/utility.hpp> 16 #include <boost/function.hpp> 17 #include <boost/shared_array.hpp> 45 const std::string& devname,
unsigned int baud_rate,
46 boost::asio::serial_port_base::parity opt_parity =
47 boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none),
48 boost::asio::serial_port_base::character_size opt_csize = boost::asio::serial_port_base::character_size(8),
49 boost::asio::serial_port_base::flow_control opt_flow =
50 boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none),
51 boost::asio::serial_port_base::stop_bits opt_stop =
52 boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one));
65 void open(
const std::string& devname,
unsigned int baud_rate,
66 boost::asio::serial_port_base::parity opt_parity =
67 boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none),
68 boost::asio::serial_port_base::character_size opt_csize = boost::asio::serial_port_base::character_size(8),
69 boost::asio::serial_port_base::flow_control opt_flow =
70 boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none),
71 boost::asio::serial_port_base::stop_bits opt_stop =
72 boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one));
95 void write(
const char*
data,
size_t size);
101 void write(
const std::vector<char>& data);
129 void readEnd(
const boost::system::error_code& error,
size_t bytes_transferred);
143 void writeEnd(
const boost::system::error_code& error);
162 void setReadCallback(
const boost::function<
void(
const char*,
size_t)>& callback);
194 const std::string& devname,
unsigned int baud_rate,
195 boost::asio::serial_port_base::parity opt_parity =
196 boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none),
197 boost::asio::serial_port_base::character_size opt_csize = boost::asio::serial_port_base::character_size(8),
198 boost::asio::serial_port_base::flow_control opt_flow =
199 boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none),
200 boost::asio::serial_port_base::stop_bits opt_stop =
201 boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one));
209 void setCallback(
const boost::function<
void(
const char*,
size_t)>& callback);
215 void clearCallback();
220 #endif // ASYNCSERIAL_H
void writeString(const std::string &s)
static const int readBufferSize
void setErrorStatus(bool e)
void writeEnd(const boost::system::error_code &error)
void setReadCallback(const boost::function< void(const char *, size_t)> &callback)
void open(const std::string &devname, unsigned int baud_rate, boost::asio::serial_port_base::parity opt_parity=boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none), boost::asio::serial_port_base::character_size opt_csize=boost::asio::serial_port_base::character_size(8), boost::asio::serial_port_base::flow_control opt_flow=boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none), boost::asio::serial_port_base::stop_bits opt_stop=boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one))
void write(const char *data, size_t size)
void readEnd(const boost::system::error_code &error, size_t bytes_transferred)
boost::shared_ptr< AsyncSerialImpl > pimpl