AWS IoT Embedded C Device SDK
Functions
timer.c File Reference

Linux implementation of the timer interface. More...

#include <stddef.h>
#include <sys/types.h>
#include "timer_linux.h"

Functions

char expired (Timer *timer)
 Check if a timer is expired. More...
 
void countdown_ms (Timer *timer, unsigned int timeout)
 Create a timer (milliseconds) More...
 
void countdown (Timer *timer, unsigned int timeout)
 Create a timer (seconds) More...
 
int left_ms (Timer *timer)
 Check the time remaining on a give timer. More...
 
void InitTimer (Timer *timer)
 Initialize a timer. More...
 

Function Documentation

void countdown ( Timer ,
unsigned  int 
)

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

Parameters
Timer- pointer to the timer to be set to expire in seconds
unsignedint - set the timer to expire in this number of seconds
void countdown_ms ( Timer ,
unsigned  int 
)

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

Parameters
Timer- pointer to the timer to be set to expire in milliseconds
unsignedint - set the timer to expire in this number of milliseconds
char expired ( Timer )

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
character - 1 = timer expired, 0 = timer not expired
void InitTimer ( Timer )

Performs any initialization required to the timer passed in.

Parameters
Timer- pointer to the timer to be initialized
int left_ms ( 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