#include <m2mtimer.h>
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 |
Timer class for mbed client.
M2MTimer::M2MTimer | ( | M2MTimerObserver & | observer | ) |
Constructor.
M2MTimer::~M2MTimer | ( | ) |
Destructor.
bool M2MTimer::is_intermediate_interval_passed | ( | ) |
Checks if the intermediate interval has passed.
bool M2MTimer::is_total_interval_passed | ( | ) |
Checks if the total interval has passed.
void M2MTimer::start_dtls_timer | ( | uint64_t | intermediate_interval, |
uint64_t | total_interval, | ||
M2MTimerObserver::Type | type = M2MTimerObserver::Dtls |
||
) |
Starts the timer in DTLS manner.
intermediate_interval | The intermediate interval to use, must be smaller than total (usually 1/4 of total). |
total_interval | The total interval to use; This is the timeout value of a DTLS packet. |
type | The type of the timer. |
void M2MTimer::start_timer | ( | uint64_t | interval, |
M2MTimerObserver::Type | type, | ||
bool | single_shot = true |
||
) |
Starts the timer.
interval | The timer interval in milliseconds. |
single_shot | Defines whether the timer is ticked once or restarted every time at expiry. |