0.01.00
ot::TimerMilli Class Reference

This class implements the millisecond timer. More...

#include <src/core/common/timer.hpp>

Inheritance diagram for ot::TimerMilli:
ot::Timer ot::InstanceLocator ot::Context ot::TrickleTimer

Public Member Functions

 TimerMilli (otInstance &aInstance, Handler aHandler, void *aContext)
 This constructor creates a millisecond timer instance. More...
 
void Start (uint32_t aDt)
 This method schedules the timer to fire a dt milliseconds from now. More...
 
void StartAt (uint32_t aT0, uint32_t aDt)
 This method schedules the timer to fire at aDt milliseconds from aT0. More...
 
void Stop (void)
 This method stops the timer.
 
- Public Member Functions inherited from ot::Timer
 Timer (otInstance &aInstance, Handler aHandler, void *aContext)
 This constructor creates a timer instance. More...
 
uint32_t GetFireTime (void) const
 This method returns the fire time of the timer. More...
 
bool IsRunning (void) const
 This method indicates whether or not the timer instance is running. More...
 
- Public Member Functions inherited from ot::InstanceLocator
otInstanceGetInstance (void) const
 This method returns a reference to the parent otInstance structure. More...
 
Ip6::Ip6GetIp6 (void) const
 This method returns a reference to the Ip6. More...
 
ThreadNetifGetNetif (void) const
 This method returns a reference to the thread network interface. More...
 

Static Public Member Functions

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...
 

Additional Inherited Members

- Public Types inherited from ot::Timer
enum  { kMaxDt = (1UL << 31) - 1 }
 
typedef void(* Handler) (Timer &aTimer)
 This function pointer is called when the timer expires. More...
 
- Protected Member Functions inherited from ot::Timer
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)
 
- Protected Member Functions inherited from ot::InstanceLocator
 InstanceLocator (otInstance &aInstance)
 This constructor initializes the object. More...
 
- Protected Member Functions inherited from ot::Context
 Context (void *aContext)
 This constructor initializes the context object. More...
 
- Protected Attributes inherited from ot::Timer
Handler mHandler
 
uint32_t mFireTime
 
TimermNext
 

Detailed Description

This class implements the millisecond timer.

Constructor & Destructor Documentation

§ TimerMilli()

ot::TimerMilli::TimerMilli ( otInstance aInstance,
Handler  aHandler,
void *  aContext 
)
inline

This constructor creates a millisecond timer instance.

Parameters
[in]aInstanceA reference to the instance.
[in]aHandlerA pointer to a function that is called when the timer expires.
[in]aContextA pointer to arbitrary context information.

Member Function Documentation

§ 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]aDtThe 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]aT0The start time in milliseconds.
[in]aDtThe 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: