Austin Blackstone / Mbed 2 deprecated mbed-client-classic-example-lwip

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of mbed-client-classic-example-lwip by sandbox

Embed: (wiki syntax)

« Back to documentation index

M2MTimer Class Reference

M2MTimer Class Reference

M2MTimer. More...

#include <m2mtimer.h>

Public Member Functions

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

Detailed Description

M2MTimer.

Timer class for mbed client.

Definition at line 28 of file m2mtimer.h.


Constructor & Destructor Documentation

M2MTimer ( M2MTimerObserver observer )

Constructor.

Definition at line 21 of file m2mtimer.cpp.

~M2MTimer (  ) [virtual]

Destructor.

Definition at line 27 of file m2mtimer.cpp.


Member Function Documentation

bool is_intermediate_interval_passed (  )

Checks if the intermediate interval has passed.

Returns:
True if interval has passed, else false.

Definition at line 51 of file m2mtimer.cpp.

bool is_total_interval_passed (  )

Checks if the total interval has passed.

Returns:
True if interval has passed, else false.

Definition at line 55 of file m2mtimer.cpp.

void start_dtls_timer ( uint64_t  intermediate_interval,
uint64_t  total_interval,
M2MTimerObserver::Type  type = M2MTimerObserver::Dtls 
)

Starts timer in DTLS manner.

Parameters:
intermediate_intervalIntermediate interval to use, must be smaller than total (usually 1/4 of total).
total_intervalTotal interval to use; This is the timeout value of a DTLS packet.
typeType of the timer.

Definition at line 42 of file m2mtimer.cpp.

void start_timer ( uint64_t  interval,
M2MTimerObserver::Type  type,
bool  single_shot = true 
)

Starts timer.

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

Definition at line 33 of file m2mtimer.cpp.

void stop_timer (  )

Stops timer.

This cancels the ongoing timer.

Definition at line 46 of file m2mtimer.cpp.