PIDUINO
Loading...
Searching...
No Matches
Piduino::SerialPort::Settings

Provides settings information about serial ports. More...

#include <serialport.h>

Collaboration diagram for Piduino::SerialPort::Settings:

Public Member Functions

 Settings (int32_t baudRate=Baud9600, DataBits dataBits=Data8, Parity parity=NoParity, StopBits stopBits=OneStop, FlowControl flowControl=NoFlowControl)
 
bool operator== (const Settings &other)
 equality operator
 
std::string toString () const
 Convert to string.
 
std::string dataBitsString () const
 Convert current data bits to string.
 
std::string parityString () const
 Convert current parity to string.
 
std::string stopBitsString () const
 Convert current stop bits to string.
 
std::string flowControlString () const
 Convert current flow control to string.
 
void updateOneByteTime ()
 Update the time of an byte in accordance with the baudrate and the number of bits of data, parity and stop.
 

Static Public Member Functions

static std::string dataBitsToString (DataBits dataBits)
 Convert data bits to string.
 
static std::string parityToString (Parity parity)
 Convert parity to string.
 
static std::string stopBitsToString (StopBits stopBits)
 Convert stop bits to string.
 
static std::string flowControlToString (FlowControl flowControl)
 Convert flow control to string.
 

Public Attributes

int32_t inputBaudRate
 data baud rate for the desired direction
 
int32_t outputBaudRate
 data baud rate for the desired direction
 
DataBits dataBits
 number of data bits used
 
Parity parity
 the parity checking mode
 
StopBits stopBits
 the number of stop bits in a frame
 
FlowControl flowControl
 the desired flow control mode
 
unsigned long onebyteTime
 time for send on byte
 
unsigned long rs485Delay
 the rs485 delay in microseconds before and after send
 

Detailed Description

Provides settings information about serial ports.

Definition at line 291 of file serialport.h.

Constructor & Destructor Documentation

◆ Settings()

Piduino::SerialPort::Settings::Settings ( int32_t  baudRate = Baud9600,
DataBits  dataBits = Data8,
Parity  parity = NoParity,
StopBits  stopBits = OneStop,
FlowControl  flowControl = NoFlowControl 
)

Constructs a new SerialPort::Settings object.

Parameters
baudRatedata baud rate (same as input and output)
dataBitsnumber of data bits used
paritythe parity checking mode
stopBitsthe number of stop bits in a frame
flowControlthe desired flow control mode

Member Function Documentation

◆ dataBitsString()

std::string Piduino::SerialPort::Settings::dataBitsString ( ) const

Convert current data bits to string.

◆ dataBitsToString()

static std::string Piduino::SerialPort::Settings::dataBitsToString ( DataBits  dataBits)
static

Convert data bits to string.

◆ flowControlString()

std::string Piduino::SerialPort::Settings::flowControlString ( ) const

Convert current flow control to string.

◆ flowControlToString()

static std::string Piduino::SerialPort::Settings::flowControlToString ( FlowControl  flowControl)
static

Convert flow control to string.

◆ operator==()

bool Piduino::SerialPort::Settings::operator== ( const Settings other)

equality operator

◆ parityString()

std::string Piduino::SerialPort::Settings::parityString ( ) const

Convert current parity to string.

◆ parityToString()

static std::string Piduino::SerialPort::Settings::parityToString ( Parity  parity)
static

Convert parity to string.

◆ stopBitsString()

std::string Piduino::SerialPort::Settings::stopBitsString ( ) const

Convert current stop bits to string.

◆ stopBitsToString()

static std::string Piduino::SerialPort::Settings::stopBitsToString ( StopBits  stopBits)
static

Convert stop bits to string.

◆ toString()

std::string Piduino::SerialPort::Settings::toString ( ) const

Convert to string.

◆ updateOneByteTime()

void Piduino::SerialPort::Settings::updateOneByteTime ( )

Update the time of an byte in accordance with the baudrate and the number of bits of data, parity and stop.

Note
If rs485Delay is lower than the new value, rs485Delay is also assigned to this value.

Member Data Documentation

◆ dataBits

DataBits Piduino::SerialPort::Settings::dataBits

number of data bits used

Definition at line 308 of file serialport.h.

◆ flowControl

FlowControl Piduino::SerialPort::Settings::flowControl

the desired flow control mode

Definition at line 311 of file serialport.h.

◆ inputBaudRate

int32_t Piduino::SerialPort::Settings::inputBaudRate

data baud rate for the desired direction

Definition at line 306 of file serialport.h.

◆ onebyteTime

unsigned long Piduino::SerialPort::Settings::onebyteTime

time for send on byte

Definition at line 312 of file serialport.h.

◆ outputBaudRate

int32_t Piduino::SerialPort::Settings::outputBaudRate

data baud rate for the desired direction

Definition at line 307 of file serialport.h.

◆ parity

Parity Piduino::SerialPort::Settings::parity

the parity checking mode

Definition at line 309 of file serialport.h.

◆ rs485Delay

unsigned long Piduino::SerialPort::Settings::rs485Delay

the rs485 delay in microseconds before and after send

Definition at line 313 of file serialport.h.

◆ stopBits

StopBits Piduino::SerialPort::Settings::stopBits

the number of stop bits in a frame

Definition at line 310 of file serialport.h.