Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef PORT_SETTINGS_T_H
00033 #define PORT_SETTINGS_T_H
00034
00035 #include <string>
00036
00037 namespace cedrus
00038 {
00046 class port_settings_t
00047 {
00048 public:
00049 enum bitparity
00050 {
00051 BITPARITY_NONE = 0,
00052 BITPARITY_ODD = 1,
00053 BITPARITY_EVEN = 2
00054 };
00055
00056 enum stopbits
00057 {
00058 STOP_BIT_1 = 0,
00059 STOP_BIT_2 = 1
00060 };
00061
00062 enum bytesize
00063 {
00064 BYTESIZE_6 = 6,
00065 BYTESIZE_7 = 7,
00066 BYTESIZE_8 = 8,
00067
00068 FIRST_BYTESIZE = BYTESIZE_6
00069 };
00070
00071 enum handshaking
00072 {
00073 HANDSHAKE_NONE = 0,
00074 HANDSHAKE_XON_XOFF = 1,
00075 HANDSHAKE_HARDWARE = 2,
00076 };
00077 port_settings_t() {}
00078
00079 port_settings_t(
00080 const std::wstring &port_name,
00081 int port_speed,
00082 bytesize byte_size = BYTESIZE_8,
00083 bitparity bit_parity = BITPARITY_NONE,
00084 stopbits stop_bits = STOP_BIT_1);
00085
00086 virtual ~port_settings_t(void);
00087
00088 const std::wstring& port_name() const;
00089
00090 int baud_rate() const;
00091 void baud_rate(int speed);
00092
00093 bitparity bit_parity() const;
00094 void bit_parity(bitparity parity);
00095
00096 bytesize byte_size() const;
00097 void byte_size(bytesize size);
00098
00099 handshaking handshake() const;
00100 void handshake(handshaking shake);
00101
00102 stopbits stop_bits() const;
00103 void stop_bits(stopbits bits);
00104
00105 private:
00106 std::wstring port_name_;
00107 int baud_rate_;
00108 bytesize byte_size_;
00109 bitparity bit_parity_;
00110 stopbits stop_bits_;
00111 handshaking handshaking_;
00112 };
00113 }
00114
00115 #endif // PORT_SETTINGS_T_H