Mistake on this page? Email us
M2MTimer Class Reference

Public Member Functions

 M2MTimer (M2MTimerObserver &observer)
 
 ~M2MTimer ()
 
void start_timer (uint64_t interval, M2MTimerObserver::Type type, bool single_shot=true)
 Starts the timer. More...
 
void start_dtls_timer (uint64_t intermediate_interval, uint64_t total_interval, M2MTimerObserver::Type type=M2MTimerObserver::Dtls)
 Starts the timer in DTLS manner. More...
 
void stop_timer ()
 Stops the timer. This cancels the ongoing timer.
 
bool is_intermediate_interval_passed ()
 Checks if the intermediate interval has passed. More...
 
bool is_total_interval_passed ()
 Checks if the total interval has passed. More...
 

Friends

class Test_M2MTimerImpl_linux
 

Constructor & Destructor Documentation

M2MTimer::M2MTimer ( M2MTimerObserver observer)

Constructor.

M2MTimer::~M2MTimer ( )

Destructor.

Member Function Documentation

bool M2MTimer::is_intermediate_interval_passed ( )

Checks if the intermediate interval has passed.

Returns
True if the interval has passed, else false.
bool M2MTimer::is_total_interval_passed ( )

Checks if the total interval has passed.

Returns
True if the interval has passed, else false.
void M2MTimer::start_dtls_timer ( uint64_t  intermediate_interval,
uint64_t  total_interval,
M2MTimerObserver::Type  type = M2MTimerObserver::Dtls 
)

Starts the timer in DTLS manner.

Parameters
intermediate_intervalThe intermediate interval to use, must be smaller than total (usually 1/4 of total).
total_intervalThe total interval to use; This is the timeout value of a DTLS packet.
typeThe type of the timer.
void M2MTimer::start_timer ( uint64_t  interval,
M2MTimerObserver::Type  type,
bool  single_shot = true 
)

Starts the timer.

Parameters
intervalThe timer interval in milliseconds.
single_shotDefines whether the timer is ticked once or restarted every time at expiry.

The documentation for this class was generated from the following file:
  • mbed-cloud-client/mbed-client/mbed-client/m2mtimer.h