Simple ThingWorx Tasker.
More...
Go to the source code of this file.
|
typedef void(* | twTaskFunction) (uint64_t sys_msecs, void *params) |
| Function signature of a task called in round robin fashion. More...
|
|
typedef struct twTask | twTask |
| Task structure definition.
|
|
typedef void(* twTaskFunction) (uint64_t sys_msecs, void *params) |
Function signature of a task called in round robin fashion.
- Parameters
-
[in] | sys_msecs | The current non-rollover 64-bit msec counter value. On a platform with millisecond datetime capabilities, this will be the current date/time. |
[in] | params | A pointer to the parameters of the function. |
- Returns
- Nothing.
- Note
- Task functions must return in a cooperative fashion.
int twTasker_CreateTask |
( |
uint32_t |
runTimeIntervalMsec, |
|
|
twTaskFunction |
func |
|
) |
| |
Adds a new task to the tasker.
- Parameters
-
[in] | runTimeIntervalMsec | The period (in msec) at which to call this task. |
[in] | func | A pointer to the function to call when executing the task. |
- Returns
- The id of the resulting task.
void twTasker_Initialize |
( |
| ) |
|
Initializes the tasker.
- Returns
- Nothing.
- Note
- Task functions are called in round robin fashion at a rate defined when the tasks are added.
int twTasker_RemoveTask |
( |
int |
id | ) |
|
Removes a task from the tasker.
- Parameters
-
[in] | id | The id of the task to be removed from the tasker. |
- Returns
- #TW_OK if successful, positive integral on error code (see twErrors.h) if an error was encountered.