Hi,
class RTSControl { public: explicit RTSControl(bool enable = false) : m_enable(enable) {}; boost::system::error_code store(BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const { #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) if (m_enable) storage.fRtsControl = RTS_CONTROL_ENABLE; else storage.fRtsControl = RTS_CONTROL_DISABLE; #else #endif return ec; }; boost::system::error_code load(const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) { #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) if (storage.fRtsControl == RTS_CONTROL_ENABLE) m_enable = true; else m_enable = true; #else #endif return ec; }; private: bool m_enable; };
BOOST_ASIO_OPTION_STORAGE is termios for Linux systems.