This class implements a timer.
More...
#include <src/core/common/timer.hpp>
|
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...
|
|
This class implements a timer.
§ Handler
typedef void(* ot::Timer::Handler) (Timer &aTimer) |
This function pointer is called when the timer expires.
- Parameters
-
[in] | aTimer | A reference to the expired timer instance. |
§ Timer()
This constructor creates a 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. |
§ DoesFireBefore()
bool ot::Timer::DoesFireBefore |
( |
const Timer & |
aTimer, |
|
|
uint32_t |
aNow |
|
) |
| |
|
protected |
This method indicates if the fire time of this timer is strictly before the fire time of a second given timer.
- Parameters
-
[in] | aTimer | A reference to the second timer object. |
[in] | aNow | The current time (may in milliseconds or microsecond, which depends on the timer type). |
- Return values
-
TRUE | If the fire time of this timer object is strictly before aTimer's fire time |
FALSE | If the fire time of this timer object is the same or after aTimer's fire time. |
§ GetFireTime()
uint32_t ot::Timer::GetFireTime |
( |
void |
| ) |
const |
|
inline |
This method returns the fire time of the timer.
- Returns
- The fire time in milliseconds.
§ IsRunning()
bool ot::Timer::IsRunning |
( |
void |
| ) |
const |
|
inline |
This method indicates whether or not the timer instance is running.
- Return values
-
TRUE | If the timer is running. |
FALSE | If the timer is not running. |
The documentation for this class was generated from the following files: