File indexing completed on 2025-01-18 09:29:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_ASIO_SERIAL_PORT_BASE_HPP
0013 #define BOOST_ASIO_SERIAL_PORT_BASE_HPP
0014
0015 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0016 # pragma once
0017 #endif
0018
0019 #include <boost/asio/detail/config.hpp>
0020
0021 #if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
0022 || defined(GENERATING_DOCUMENTATION)
0023
0024 #if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
0025 # include <termios.h>
0026 #endif
0027
0028 #include <boost/asio/detail/socket_types.hpp>
0029 #include <boost/system/error_code.hpp>
0030
0031 #if defined(GENERATING_DOCUMENTATION)
0032 # define BOOST_ASIO_OPTION_STORAGE implementation_defined
0033 #elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
0034 # define BOOST_ASIO_OPTION_STORAGE DCB
0035 #else
0036 # define BOOST_ASIO_OPTION_STORAGE termios
0037 #endif
0038
0039 #include <boost/asio/detail/push_options.hpp>
0040
0041 namespace boost {
0042 namespace asio {
0043
0044
0045
0046 class serial_port_base
0047 {
0048 public:
0049
0050
0051
0052
0053 class baud_rate
0054 {
0055 public:
0056 explicit baud_rate(unsigned int rate = 0);
0057 unsigned int value() const;
0058 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID store(
0059 BOOST_ASIO_OPTION_STORAGE& storage,
0060 boost::system::error_code& ec) const;
0061 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID load(
0062 const BOOST_ASIO_OPTION_STORAGE& storage,
0063 boost::system::error_code& ec);
0064 private:
0065 unsigned int value_;
0066 };
0067
0068
0069
0070
0071
0072 class flow_control
0073 {
0074 public:
0075 enum type { none, software, hardware };
0076 BOOST_ASIO_DECL explicit flow_control(type t = none);
0077 type value() const;
0078 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID store(
0079 BOOST_ASIO_OPTION_STORAGE& storage,
0080 boost::system::error_code& ec) const;
0081 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID load(
0082 const BOOST_ASIO_OPTION_STORAGE& storage,
0083 boost::system::error_code& ec);
0084 private:
0085 type value_;
0086 };
0087
0088
0089
0090
0091
0092 class parity
0093 {
0094 public:
0095 enum type { none, odd, even };
0096 BOOST_ASIO_DECL explicit parity(type t = none);
0097 type value() const;
0098 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID store(
0099 BOOST_ASIO_OPTION_STORAGE& storage,
0100 boost::system::error_code& ec) const;
0101 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID load(
0102 const BOOST_ASIO_OPTION_STORAGE& storage,
0103 boost::system::error_code& ec);
0104 private:
0105 type value_;
0106 };
0107
0108
0109
0110
0111
0112 class stop_bits
0113 {
0114 public:
0115 enum type { one, onepointfive, two };
0116 BOOST_ASIO_DECL explicit stop_bits(type t = one);
0117 type value() const;
0118 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID store(
0119 BOOST_ASIO_OPTION_STORAGE& storage,
0120 boost::system::error_code& ec) const;
0121 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID load(
0122 const BOOST_ASIO_OPTION_STORAGE& storage,
0123 boost::system::error_code& ec);
0124 private:
0125 type value_;
0126 };
0127
0128
0129
0130
0131
0132 class character_size
0133 {
0134 public:
0135 BOOST_ASIO_DECL explicit character_size(unsigned int t = 8);
0136 unsigned int value() const;
0137 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID store(
0138 BOOST_ASIO_OPTION_STORAGE& storage,
0139 boost::system::error_code& ec) const;
0140 BOOST_ASIO_DECL BOOST_ASIO_SYNC_OP_VOID load(
0141 const BOOST_ASIO_OPTION_STORAGE& storage,
0142 boost::system::error_code& ec);
0143 private:
0144 unsigned int value_;
0145 };
0146
0147 protected:
0148
0149 ~serial_port_base()
0150 {
0151 }
0152 };
0153
0154 }
0155 }
0156
0157 #include <boost/asio/detail/pop_options.hpp>
0158
0159 #undef BOOST_ASIO_OPTION_STORAGE
0160
0161 #include <boost/asio/impl/serial_port_base.hpp>
0162 #if defined(BOOST_ASIO_HEADER_ONLY)
0163 # include <boost/asio/impl/serial_port_base.ipp>
0164 #endif
0165
0166 #endif
0167
0168
0169 #endif