Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
serial::Timeout Struct Reference

#include <serial.h>

Public Member Functions

 Timeout (uint32_t inter_byte_timeout_=0, uint32_t read_timeout_constant_=0, uint32_t read_timeout_multiplier_=0, uint32_t write_timeout_constant_=0, uint32_t write_timeout_multiplier_=0)
 

Static Public Member Functions

static uint32_t max ()
 
static Timeout simpleTimeout (uint32_t timeout)
 

Public Attributes

uint32_t inter_byte_timeout
 
uint32_t read_timeout_constant
 
uint32_t read_timeout_multiplier
 
uint32_t write_timeout_constant
 
uint32_t write_timeout_multiplier
 

Detailed Description

Structure for setting the timeout of the serial port, times are in milliseconds.

In order to disable the interbyte timeout, set it to Timeout::max().

Definition at line 98 of file serial.h.

Constructor & Destructor Documentation

◆ Timeout()

serial::Timeout::Timeout ( uint32_t  inter_byte_timeout_ = 0,
uint32_t  read_timeout_constant_ = 0,
uint32_t  read_timeout_multiplier_ = 0,
uint32_t  write_timeout_constant_ = 0,
uint32_t  write_timeout_multiplier_ = 0 
)
inlineexplicit

Definition at line 131 of file serial.h.

Member Function Documentation

◆ max()

static uint32_t serial::Timeout::max ( )
inlinestatic

Definition at line 102 of file serial.h.

◆ simpleTimeout()

static Timeout serial::Timeout::simpleTimeout ( uint32_t  timeout)
inlinestatic

Convenience function to generate Timeout structs using a single absolute timeout.

Parameters
timeoutA long that defines the time in milliseconds until a timeout occurs after a call to read or write is made.
Returns
Timeout struct that represents this simple timeout provided.

Definition at line 112 of file serial.h.

Member Data Documentation

◆ inter_byte_timeout

uint32_t serial::Timeout::inter_byte_timeout

Number of milliseconds between bytes received to timeout on.

Definition at line 117 of file serial.h.

◆ read_timeout_constant

uint32_t serial::Timeout::read_timeout_constant

A constant number of milliseconds to wait after calling read.

Definition at line 119 of file serial.h.

◆ read_timeout_multiplier

uint32_t serial::Timeout::read_timeout_multiplier

A multiplier against the number of requested bytes to wait after calling read.

Definition at line 123 of file serial.h.

◆ write_timeout_constant

uint32_t serial::Timeout::write_timeout_constant

A constant number of milliseconds to wait after calling write.

Definition at line 125 of file serial.h.

◆ write_timeout_multiplier

uint32_t serial::Timeout::write_timeout_multiplier

A multiplier against the number of requested bytes to wait after calling write.

Definition at line 129 of file serial.h.


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


ubiquity_motor
Author(s):
autogenerated on Thu Nov 16 2023 03:30:56