modbuspp  1.1.40
C++ wrapper for the libmodbus library
Modbus::Timeout Class Reference

Represents a timeout. More...

#include <timeout.h>

Public Member Functions

Timeoutoperator= (const double &t)
 Overload of the assignment operator from a double value. More...
 
uint32_t sec () const
 Return the number of seconds.
 
void setValue (const double &t)
 Set value from a double. More...
 
void setValue (uint32_t s, uint32_t us)
 Set the value from the integer part and the decimal part. More...
 
 Timeout (uint32_t s=1, uint32_t us=0)
 Default constructor. More...
 
 Timeout (const double &t)
 Constructor from a double. More...
 
uint32_t usec () const
 Return the number of microseconds. More...
 
double value () const
 Return the timeout in seconds.
 

Detailed Description

Represents a timeout.

Author
Pascal JEAN, aka epsilonrt

Constructor & Destructor Documentation

◆ Timeout() [1/2]

Modbus::Timeout::Timeout ( uint32_t  s = 1,
uint32_t  us = 0 
)

Default constructor.

Parameters
sseconds
usmicroseconds

◆ Timeout() [2/2]

Modbus::Timeout::Timeout ( const double &  t)

Constructor from a double.

Parameters
ttime in seconds

Member Function Documentation

◆ operator=()

Timeout& Modbus::Timeout::operator= ( const double &  t)
inline

Overload of the assignment operator from a double value.

Parameters
ttime in seconds

References setValue().

Here is the call graph for this function:

◆ setValue() [1/2]

void Modbus::Timeout::setValue ( const double &  t)

Set value from a double.

Parameters
ttime in seconds

Referenced by operator=().

Here is the caller graph for this function:

◆ setValue() [2/2]

void Modbus::Timeout::setValue ( uint32_t  s,
uint32_t  us 
)

Set the value from the integer part and the decimal part.

Parameters
sseconds
usmicroseconds, if this value is greater than 999999, it is adjusted as well as s.

◆ usec()

uint32_t Modbus::Timeout::usec ( ) const
inline

Return the number of microseconds.

in the range 0 to 999999.