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, uint32_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) |
Detailed Description
Legato Timer API include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
Typedef Documentation
typedef void(* le_timer_ExpiryHandler_t) (le_timer_Ref_t timerRef) |
Prototype for timer expiry handler function.
- Parameters
-
timerRef Timer that has expired
typedef struct le_timer* le_timer_Ref_t |
Timer object. Created by le_timer_Create().
Function Documentation
le_timer_Ref_t le_timer_Create | ( | const char * | nameStr | ) |
Create the timer object.
- Returns
- A reference to the timer object.
- Parameters
-
[in] nameStr Name of the timer.
void le_timer_Delete | ( | le_timer_Ref_t | timerRef | ) |
Delete the timer object.
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[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.
- Returns
- Context pointer, which could be NULL if it was not set.
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[in] timerRef Get context pointer 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.
- Returns
- Expiry count, or zero if the timer has never expired.
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[in] timerRef Get expiry count for this timer object
bool le_timer_IsRunning | ( | le_timer_Ref_t | timerRef | ) |
Is the timer currently running?
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[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.
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[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.
- Returns
- LE_OK on success
- LE_BUSY if the timer is currently running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[in] timerRef Set context pointer 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.
- Returns
- LE_OK on success
- LE_BUSY if the timer is currently running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[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.
- Returns
- LE_OK on success
- LE_BUSY if the timer is currently running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[in] timerRef Set interval for this timer object. [in] interval Timer interval.
le_result_t le_timer_SetMsInterval | ( | le_timer_Ref_t | timerRef, |
uint32_t | interval | ||
) |
Set the timer interval using milliseconds.
Timer will expire after the interval has elapsed.
- Returns
- LE_OK on success
- LE_BUSY if the timer is currently running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[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.
- Returns
- LE_OK on success
- LE_BUSY if the timer is currently running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[in] timerRef Set repeat count 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.
- Returns
- LE_OK on success
- LE_BUSY if the timer is already running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[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.
- Returns
- LE_OK on success
- LE_FAULT if the timer is not currently running
- Note
- If an invalid timer object is given, the process exits.
- Parameters
-
[in] timerRef Stop this timer object.