SerialPort
A light-weight C++ library for cross-platform serial communication.
Loading...
Searching...
No Matches
serial_port::Settings Struct Reference

Describes the settings of a port. More...

#include <types.h>

Public Member Functions

 Settings ()=default
 Default constructor.
 
 Settings (const std::string &port_name, const int baud_rate, const Parity parity, const NumStopBits num_stop_bits, const bool hardware_flow_control, const unsigned long timeout_s, const unsigned long timeout_ms)
 Constructor initializing the settings.
 

Public Attributes

std::string port_name { kDefaultName }
 Name of the port.
 
int baud_rate { 9600 }
 Baud rate.
 
Parity parity { Parity::kNone }
 Parity.
 
NumStopBits num_stop_bits { NumStopBits::kOne }
 Number of stop bits.
 
bool hardware_flow_control { false }
 Hardware flow control.
 
unsigned long timeout_s { 0 }
 Timeout in seconds.
 
unsigned long timeout_ms { 0 }
 Timeout in milliseconds.
 

Friends

bool operator== (const Settings &lhs, const Settings &rhs)
 Overloaded equality operator.
 
bool operator!= (const Settings &lhs, const Settings &rhs)
 Overloaded inequality operator.
 
std::ostream & operator<< (std::ostream &os, const Settings &obj)
 Overloaded stream output operator.
 

Detailed Description

Describes the settings of a port.

Constructor & Destructor Documentation

◆ Settings()

serial_port::Settings::Settings ( const std::string & port_name,
const int baud_rate,
const Parity parity,
const NumStopBits num_stop_bits,
const bool hardware_flow_control,
const unsigned long timeout_s,
const unsigned long timeout_ms )
inline

Constructor initializing the settings.

Parameters
port_nameName of the port
baud_rateBaud rate
parityParity used
num_stop_bitsNumber of stop bits
hardware_flow_controlHardware flow control (on or off)
timeout_sTimeout in seconds
timeout_msTimeout in milliseconds

The documentation for this struct was generated from the following file: