This class implements the millisecond timer.
More...
#include <src/core/common/timer.hpp>
|
static uint32_t | GetNow (void) |
| This static method returns the current time in milliseconds. More...
|
|
static uint32_t | SecToMsec (uint32_t aSeconds) |
| This static method returns the number of milliseconds given seconds. More...
|
|
static uint32_t | MsecToSec (uint32_t aMilliseconds) |
| This static method returns the number of seconds given milliseconds. More...
|
|
|
enum | { kMaxDt = (1UL << 31) - 1
} |
|
typedef void(* | Handler) (Timer &aTimer) |
| This function pointer is called when the timer expires. More...
|
|
bool | DoesFireBefore (const Timer &aTimer, uint32_t aNow) |
| This method indicates if the fire time of this timer is strictly before the fire time of a second given timer. More...
|
|
void | Fired (void) |
|
| InstanceLocator (otInstance &aInstance) |
| This constructor initializes the object. More...
|
|
| Context (void *aContext) |
| This constructor initializes the context object. More...
|
|
Handler | mHandler |
|
uint32_t | mFireTime |
|
Timer * | mNext |
|
This class implements the millisecond timer.
§ TimerMilli()
ot::TimerMilli::TimerMilli |
( |
otInstance & |
aInstance, |
|
|
Handler |
aHandler, |
|
|
void * |
aContext |
|
) |
| |
|
inline |
This constructor creates a millisecond timer instance.
- Parameters
-
[in] | aInstance | A reference to the instance. |
[in] | aHandler | A pointer to a function that is called when the timer expires. |
[in] | aContext | A pointer to arbitrary context information. |
§ GetNow()
static uint32_t ot::TimerMilli::GetNow |
( |
void |
| ) |
|
|
inlinestatic |
This static method returns the current time in milliseconds.
- Returns
- The current time in milliseconds.
§ MsecToSec()
static uint32_t ot::TimerMilli::MsecToSec |
( |
uint32_t |
aMilliseconds | ) |
|
|
inlinestatic |
This static method returns the number of seconds given milliseconds.
- Returns
- The number of seconds.
§ SecToMsec()
static uint32_t ot::TimerMilli::SecToMsec |
( |
uint32_t |
aSeconds | ) |
|
|
inlinestatic |
This static method returns the number of milliseconds given seconds.
- Returns
- The number of milliseconds.
§ Start()
void ot::TimerMilli::Start |
( |
uint32_t |
aDt | ) |
|
|
inline |
This method schedules the timer to fire a dt
milliseconds from now.
- Parameters
-
[in] | aDt | The expire time in milliseconds from now. (aDt must be smaller than or equal to kMaxDt). |
§ StartAt()
void ot::TimerMilli::StartAt |
( |
uint32_t |
aT0, |
|
|
uint32_t |
aDt |
|
) |
| |
This method schedules the timer to fire at aDt
milliseconds from aT0
.
- Parameters
-
[in] | aT0 | The start time in milliseconds. |
[in] | aDt | The expire time in milliseconds from aT0 . (aDt must be smaller than or equal to kMaxDt). |
The documentation for this class was generated from the following files: