Go to the source code of this file.
Typedefs | |
typedef struct le_timer * | le_timer_Ref_t |
typedef void(* | le_timer_ExpiryHandler_t) (le_timer_Ref_t timerRef) |
Functions | |
le_timer_Ref_t | le_timer_Create (const char *nameStr) |
void | le_timer_Delete (le_timer_Ref_t timerRef) |
le_result_t | le_timer_SetHandler (le_timer_Ref_t timerRef, le_timer_ExpiryHandler_t handlerFunc) |
le_result_t | le_timer_SetInterval (le_timer_Ref_t timerRef, le_clk_Time_t interval) |
le_result_t | le_timer_SetMsInterval (le_timer_Ref_t timerRef, size_t interval) |
le_result_t | le_timer_SetRepeat (le_timer_Ref_t timerRef, uint32_t repeatCount) |
le_result_t | le_timer_SetContextPtr (le_timer_Ref_t timerRef, void *contextPtr) |
void * | le_timer_GetContextPtr (le_timer_Ref_t timerRef) |
uint32_t | le_timer_GetExpiryCount (le_timer_Ref_t timerRef) |
le_result_t | le_timer_Start (le_timer_Ref_t timerRef) |
le_result_t | le_timer_Stop (le_timer_Ref_t timerRef) |
void | le_timer_Restart (le_timer_Ref_t timerRef) |
bool | le_timer_IsRunning (le_timer_Ref_t timerRef) |
Legato Timer API include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
typedef void(* le_timer_ExpiryHandler_t) (le_timer_Ref_t timerRef) |
Prototype for timer expiry handler function.
timerRef | Timer that has expired |
typedef struct le_timer* le_timer_Ref_t |
Timer object. Created by le_timer_Create().
le_timer_Ref_t le_timer_Create | ( | const char * | nameStr | ) |
Create the timer object.
[in] | nameStr | Name of the timer. |
void le_timer_Delete | ( | le_timer_Ref_t | timerRef | ) |
Delete the timer object.
[in] | timerRef | Delete this timer object |
void* le_timer_GetContextPtr | ( | le_timer_Ref_t | timerRef | ) |
Get context pointer for the timer.
This can be used when the timer expires to retrieve data that was previously set.
[in] | timerRef | Set interval for this timer object. |
uint32_t le_timer_GetExpiryCount | ( | le_timer_Ref_t | timerRef | ) |
Get the expiry count of a timer.
The count is returned for currently running and idle timers. The expiry count is reset every time the timer is (re)started.
[in] | timerRef | Set interval for this timer object. |
bool le_timer_IsRunning | ( | le_timer_Ref_t | timerRef | ) |
Is the timer currently running?
[in] | timerRef | Is this timer object currently running? |
void le_timer_Restart | ( | le_timer_Ref_t | timerRef | ) |
Re-start the timer.
Start the given timer. If the timer is currently running, it will be stopped and then started. If the timer is not currently running, it will be started.
[in] | timerRef | (Re)start this timer object. |
le_result_t le_timer_SetContextPtr | ( | le_timer_Ref_t | timerRef, |
void * | contextPtr | ||
) |
Set context pointer for the timer.
This can be used to pass data to the timer when it expires.
[in] | timerRef | Set interval for this timer object. |
[in] | contextPtr | Context Pointer. |
le_result_t le_timer_SetHandler | ( | le_timer_Ref_t | timerRef, |
le_timer_ExpiryHandler_t | handlerFunc | ||
) |
Set the timer expiry handler function.
If the handler is NULL, then the previous handler will be removed.
[in] | timerRef | Set expiry handler for this timer object. |
[in] | handlerFunc | Handler function to call on expiry. |
le_result_t le_timer_SetInterval | ( | le_timer_Ref_t | timerRef, |
le_clk_Time_t | interval | ||
) |
Set the timer interval.
Timer will expire after the interval has elapsed.
[in] | timerRef | Set interval for this timer object. |
[in] | interval | Timer interval. |
le_result_t le_timer_SetMsInterval | ( | le_timer_Ref_t | timerRef, |
size_t | interval | ||
) |
Set the timer interval using milliseconds.
Timer will expire after the interval has elapsed.
[in] | timerRef | Set interval for this timer object. |
[in] | interval | Timer interval in milliseconds. |
le_result_t le_timer_SetRepeat | ( | le_timer_Ref_t | timerRef, |
uint32_t | repeatCount | ||
) |
Set how many times the timer will repeat.
Timer will repeat the given number of times. A value of 0 means repeat indefinitely. The default is 1, so that a one-shot timer is the default.
[in] | timerRef | Set interval for this timer object. |
[in] | repeatCount | Number of times the timer will repeat (0 = forever). |
le_result_t le_timer_Start | ( | le_timer_Ref_t | timerRef | ) |
Start the timer.
Start the given timer. The timer must not be currently running.
[in] | timerRef | Start this timer object. |
le_result_t le_timer_Stop | ( | le_timer_Ref_t | timerRef | ) |
Stop the timer.
Stop the given timer. The timer must be running.
[in] | timerRef | Stop this timer object. |