12 #ifndef SERIAL_CONFIG_H
13 #define SERIAL_CONFIG_H
166 static std::string
parseDevice(
const std::string &rawDevice);
167 static speed_t
parseSpeed(
const std::string &rawSpeed);
168 static tcflag_t
parseDataBits(
const std::string &rawDataBits);
201 #endif // #ifndef SERIAL_CONFIG_H
Definition: serial_config.h:46
bool operator==(const SerialConfig &other) const
Equality comparison.
std::map< std::string, std::string > RawConfigValues
Raw configuration option -> values mapping.
Definition: config.h:40
Definition: serial_config.h:38
static std::string parseDevice(const std::string &rawDevice)
SerialConfig & operator=(const SerialConfig &other)
Assignment operator.
static const Parity DEFAULT_PARITY
Default parity bit generation type.
Definition: serial_config.h:194
speed_t _speed
Serial port speed (in baudes).
Definition: serial_config.h:177
Parity
Parity bit generation types.
Definition: serial_config.h:36
Configuration for a TCP/IP server.
Definition: serial_config.h:30
speed_t getSpeed() const
Returns the serial port speed.
Definition: serial_config.h:132
std::string getDevice() const
Returns the serial port device.
Definition: serial_config.h:129
Config class - declarations.
Definition: serial_config.h:53
static const StopBits DEFAULT_STOP_BITS
Default number of stop bits.
Definition: serial_config.h:196
Definition: serial_config.h:54
FlowControl _flowControl
Flow control type.
Definition: serial_config.h:185
static speed_t parseSpeed(const std::string &rawSpeed)
static FlowControl parseFlowControl(const std::string &rawFlowControl)
BaseException class - declarations.
Base class for all configuration classes.
Definition: config.h:28
Definition: serial_config.h:55
std::string _device
Serial port device.
Definition: serial_config.h:175
Definition: serial_config.h:39
Definition: serial_config.h:37
StopBits getStopBits() const
Returns the number of stop bits.
Definition: serial_config.h:141
StopBits
Number of stop bits.
Definition: serial_config.h:45
static const speed_t DEFAULT_SPEED
Default speed.
Definition: serial_config.h:190
tcflag_t getDataBits() const
Returns the number of data bits.
Definition: serial_config.h:135
Definition: serial_config.h:40
static tcflag_t parseDataBits(const std::string &rawDataBits)
static Parity parseParity(const std::string &rawParity)
Definition: serial_config.h:48
std::map< std::string, std::string > RawConfigValues
Raw configuration option -> values mapping.
Definition: serial_config.h:33
Parity getParity() const
Returns the parity bit generation type.
Definition: serial_config.h:138
tcflag_t _dataBits
Number of data bits.
Definition: serial_config.h:179
Definition: serial_config.h:47
static const tcflag_t DEFAULT_DATA_BITS
Default number of data bits.
Definition: serial_config.h:192
static const FlowControl DEFAULT_FLOW_CONTROL
Default flow control.
Definition: serial_config.h:198
static SerialConfig fromRawConfigValues(RawConfigValues rawConfigValues)
Creates a SerialConfig object from raw configuration values.
Parity _parity
Parity bit generation type.
Definition: serial_config.h:181
static StopBits parseStopBits(const std::string &rawStopBits)
~SerialConfig()
Destructor.
Definition: serial_config.h:41
FlowControl
Flow control types.
Definition: serial_config.h:52
StopBits _stopBits
Number of stop bits.
Definition: serial_config.h:183
void swap(SerialConfig &other)
Swap the contents of this object with the other object.
bool operator!=(const SerialConfig &other) const
Non-equality comparison.
FlowControl getFlowControl() const
Returns the flow control type.
Definition: serial_config.h:144
static const std::string DEFAULT_DEVICE
Default interface.
Definition: serial_config.h:188
SerialConfig()
Default constructor.