10#ifndef ZEP_SERIAL_PORT_CONFIG_HPP_
11#define ZEP_SERIAL_PORT_CONFIG_HPP_
53 PortConfig() noexcept {}
63 PortConfig(
int baud_rate,
int data_bits, StopBits stop_bits,
64 Parity parity)
noexcept
65 PortConfig(
int baud_rate,
int data_bits, StopBits stop_bits, Parity parity)
66 data_bits_(data_bits), stop_bits_(stop_bits)
67 stop_bits_(stop_bits), parity_(parity)
80 void SetBaudRate(
int new_value)
noexcept { baud_rate_ = new_value; }
92 void SetDataBits(
int new_value)
noexcept { data_bits_ = new_value; }
104 void SetStopBits(StopBits new_value)
noexcept { stop_bits_ = new_value; }
116 void SetParity(Parity new_value)
noexcept { parity_ = new_value; }
122 int baud_rate_ = 9600;
132 StopBits stop_bits_ = StopBits::kOne;
137 Parity parity_ = Parity::kNone;
Class to store settings for general serial ports.
Definition PortConfig.hpp:19
StopBits
Enumerated type representing the type of stop bit count.
Definition PortConfig.hpp:24
Parity
パリティチェックの種類を表す列挙型。
Definition PortConfig.hpp:38
void SetParity(Parity new_value) noexcept
Set parity.
Definition PortConfig.hpp:116
int GetBaudRate() const noexcept
Get baud rate (in bps).
Definition PortConfig.hpp:73
int GetDataBits() const noexcept
Get the number of bits of data (character).
Definition PortConfig.hpp:85
void SetDataBits(int new_value) noexcept
Set the number of data (character) bits.
Definition PortConfig.hpp:92
Parity GetParity() const noexcept
Get parity.
Definition PortConfig.hpp:109
void SetStopBits(StopBits new_value) noexcept
Get the number of stop bits.
Definition PortConfig.hpp:104
void SetBaudRate(int new_value) noexcept
Set baud rate (in bps).
Definition PortConfig.hpp:80
StopBits GetStopBits() const noexcept
Get the number of stop bits.
Definition PortConfig.hpp:97
Namespace for ZEP SDK.
Definition FactoryInterface.hpp:19