test

Embed: (wiki syntax)

« Back to documentation index

timer_interface.h File Reference

timer_interface.h File Reference

Timer interface definition for MQTT client. More...

Go to the source code of this file.

Typedefs

typedef TimerExt TimerAWS
 The platform specific timer header that defines the Timer struct.

Functions

bool has_timer_expired (TimerAWS *)
 Check if a timer is expired.
void countdown_ms (TimerAWS *, uint32_t)
 Create a timer (milliseconds)
void countdown_sec (TimerAWS *, uint32_t)
 Create a timer (seconds)
uint32_t left_ms (TimerAWS *)
 Check the time remaining on a given timer.
void init_timer (TimerAWS *)
 Initialize a timer.

Detailed Description

Timer interface definition for MQTT client.

Defines an interface to timers that can be used by other system components. MQTT client requires timers to handle timeouts and MQTT keep alive. Starting point for porting the SDK to the timer hardware layer of a new platform.

Definition in file timer_interface.h.


Typedef Documentation

typedef TimerExt TimerAWS

The platform specific timer header that defines the Timer struct.

Timer Type

Forward declaration of a timer struct. The definition of this struct is platform dependent. When porting to a new platform add this definition in "timer_<platform>.h" and include that file above.

Definition at line 51 of file timer_interface.h.


Function Documentation

void countdown_ms ( TimerAWS ,
uint32_t   
)

Create a timer (milliseconds)

Sets the timer to expire in a specified number of milliseconds.

Parameters:
Timer- pointer to the timer to be set to expire in milliseconds
uint32_t- set the timer to expire in this number of milliseconds

Definition at line 20 of file timer.cpp.

void countdown_sec ( TimerAWS ,
uint32_t   
)

Create a timer (seconds)

Sets the timer to expire in a specified number of seconds.

Parameters:
Timer- pointer to the timer to be set to expire in seconds
uint32_t- set the timer to expire in this number of seconds

Definition at line 26 of file timer.cpp.

bool has_timer_expired ( TimerAWS  )

Check if a timer is expired.

Call this function passing in a timer to check if that timer has expired.

Parameters:
Timer- pointer to the timer to be checked for expiration
Returns:
bool - true = timer expired, false = timer not expired

Definition at line 16 of file timer.cpp.

void init_timer ( TimerAWS  )

Initialize a timer.

Performs any initialization required to the timer passed in.

Parameters:
Timer- pointer to the timer to be initialized

Definition at line 38 of file timer.cpp.

uint32_t left_ms ( TimerAWS  )

Check the time remaining on a given timer.

Checks the input timer and returns the number of milliseconds remaining on the timer.

Parameters:
Timer- pointer to the timer to be set to checked
Returns:
int - milliseconds left on the countdown timer

Definition at line 32 of file timer.cpp.