Jim Flynn / Mbed OS aws-iot-device-sdk-mbed-c
Embed: (wiki syntax)

« Back to documentation index

timer.c File Reference

timer.c File Reference

Linux implementation of the timer interface. More...

Go to the source code of this file.

Functions

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

Detailed Description

Linux implementation of the timer interface.

Definition in file timer.c.


Function Documentation

void countdown_ms ( awsTimer ,
uint32_t   
)

Create a timer (milliseconds)

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

Parameters:
awsTimer- 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 83 of file timer.c.

void countdown_sec ( awsTimer ,
uint32_t   
)

Create a timer (seconds)

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

Parameters:
awsTimer- 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 105 of file timer.c.

bool has_timer_expired ( awsTimer  )

Check if a timer is expired.

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

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

Definition at line 76 of file timer.c.

void init_timer ( awsTimer  )

Initialize a timer.

Performs any initialization required to the timer passed in.

Parameters:
awsTimer- pointer to the timer to be initialized

Definition at line 112 of file timer.c.

uint32_t left_ms ( awsTimer  )

Check the time remaining on a given timer.

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

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

Definition at line 94 of file timer.c.