VSM C++ SDK
Vehicle Specific Modules SDK
ugcs::vsm::Serial_processor::Stream::Mode Class Reference

Communication mode parameters for a serial port. More...

#include <serial_processor.h>

Public Member Functions

ModeBaud (int baud)
 Set baud rate. More...
 
ModeChar_size (int size)
 Set character size. More...
 
ModeStop_bit (bool enable)
 Set number of stop bits. More...
 
ModeParity_check (bool enable)
 Set parity check/generation mode. More...
 
ModeParity (bool is_odd)
 Set parity mode. More...
 
ModeRead_timeout (std::chrono::milliseconds timeout)
 Set read timeout. More...
 
int Get_baud () const
 
int Get_char_size () const
 
bool Get_stop_bit () const
 
bool Get_parity_check () const
 
bool Get_parity () const
 

Protected Attributes

int baud = 1800
 Serial port operating parameters. More...
 
int char_size = 8
 
bool stop_bit = false
 
bool parity_check = false
 
bool parity = false
 
std::chrono::milliseconds read_timeout = std::chrono::milliseconds(100)
 

Detailed Description

Communication mode parameters for a serial port.

Member Function Documentation

Mode& ugcs::vsm::Serial_processor::Stream::Mode::Baud ( int  baud)
inline

Set baud rate.

Parameters
baudBaud rate. The value is rounded to the closest allowed one.
Mode& ugcs::vsm::Serial_processor::Stream::Mode::Char_size ( int  size)
inline

Set character size.

Parameters
sizeCharacter size in bits.
Mode& ugcs::vsm::Serial_processor::Stream::Mode::Parity ( bool  is_odd)
inline

Set parity mode.

Parameters
is_oddIf "true", then parity for input and output is odd; otherwise even parity is used.
Mode& ugcs::vsm::Serial_processor::Stream::Mode::Parity_check ( bool  enable)
inline

Set parity check/generation mode.

Parameters
enableEnable parity check on input and generation on output when "true".
Mode& ugcs::vsm::Serial_processor::Stream::Mode::Read_timeout ( std::chrono::milliseconds  timeout)
inline

Set read timeout.

It specifies the minimum amount of time to wait for data, if maximum number of requested bytes is not received. Note that maximum supported value is platform specific.

Parameters
timeoutRead timeout.
Exceptions
Invalid_param_exceptionif negative timeout is specified.
Mode& ugcs::vsm::Serial_processor::Stream::Mode::Stop_bit ( bool  enable)
inline

Set number of stop bits.

Parameters
enableTwo stop bits if "true", one stop bit otherwise.

Member Data Documentation

int ugcs::vsm::Serial_processor::Stream::Mode::baud = 1800
protected

Serial port operating parameters.


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