48 #ifndef _MIRA_SERIALPORT_H_ 49 #define _MIRA_SERIALPORT_H_ 52 #include <boost/asio/serial_port.hpp> 57 #define MIRA_ASIO_OPTION_STORAGE termios 115 typedef boost::asio::serial_port::parity
Parity;
116 typedef boost::asio::serial_port::stop_bits
StopBits;
127 #if BOOST_VERSION < 106600 128 SerialPort(boost::asio::io_service& service,
const std::string& device,
130 SerialPort(boost::asio::io_context& service,
const std::string& device,
145 operator boost::asio::serial_port&()
151 operator const boost::asio::serial_port&()
const 157 boost::asio::serial_port&
port()
163 const boost::asio::serial_port&
port()
const 171 #if BOOST_VERSION < 104700 217 #if BOOST_VERSION < 104700 218 explicit Baudrate(boost::asio::serial_port::native_type handle,
220 explicit Baudrate(boost::asio::serial_port::native_handle_type handle,
223 mHandle(handle), mRate(
rate)
231 boost::system::error_code& ec)
const;
233 boost::system::error_code& ec)
235 ec = boost::system::error_code();
239 #if BOOST_VERSION < 104700 240 boost::asio::serial_port::native_type mHandle;
242 boost::asio::serial_port::native_handle_type mHandle;
virtual ~SerialPort()
The destructor.
Definition: SerialPort.h:139
This class acts as a wrapper to boost::asio::serial_port.
Definition: SerialPort.h:112
#define MIRA_ASIO_OPTION_STORAGE
Definition: SerialPort.h:57
boost::asio::serial_port::parity Parity
Definition: SerialPort.h:115
const boost::asio::serial_port & port() const
Access to the underlying boost::asio::serial_port object.
Definition: SerialPort.h:163
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
boost::system::error_code store(MIRA_ASIO_OPTION_STORAGE &storage, boost::system::error_code &ec) const
SerialPort & setParity(Parity::type parity)
Set a new parity.
Definition: SerialPort.h:181
SerialPort(boost::asio::io_service &service, const std::string &device, uint32 baudrate)
Construct a new serial port with the given I/O service.
Definition: SerialPort.h:128
PropertyHint type(const std::string &t)
Sets the attribute "type" to the specified value.
Definition: PropertyHint.h:295
SerialPort & setStopBits(StopBits::type stopbits)
Set a new stop bits configuration.
Definition: SerialPort.h:188
uint32 rate() const
Definition: SerialPort.h:225
boost::asio::serial_port mSerialPort
The underlying boost::asio::serial_port object.
Definition: SerialPort.h:210
Baudrate(boost::asio::serial_port::native_type handle, uint32 rate=0)
Definition: SerialPort.h:218
boost::asio::serial_port::character_size CharacterSize
Definition: SerialPort.h:118
boost::system::error_code load(const MIRA_ASIO_OPTION_STORAGE &storage, boost::system::error_code &ec)
Definition: SerialPort.h:232
SerialPort & setDataBits(uint32 databits)
Set a new data bits configuration.
Definition: SerialPort.h:195
An internal class for handling the baudrate.
Definition: SerialPort.h:214
boost::asio::serial_port::stop_bits StopBits
Definition: SerialPort.h:116
SerialPort & setFlowControl(FlowControl::type flowcontrol)
Set a new flow control (handshake) configuration.
Definition: SerialPort.h:202
SerialPort & setBaudrate(uint32 rate)
Set a new baudrate.
Definition: SerialPort.h:169
boost::asio::serial_port::flow_control FlowControl
Definition: SerialPort.h:117
boost::asio::serial_port & port()
Access to the underlying boost::asio::serial_port object.
Definition: SerialPort.h:157