ThingWorx C SDK
twTasker.h
Go to the documentation of this file.
1 /***************************************
2  * Copyright (C) 2015 ThingWorx Inc. *
3  ***************************************/
4 
10 #ifndef TASKER_H
11 #define TASKER_H
12 
13 #include "twDefaultSettings.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
32 typedef void (*twTaskFunction) (uint64_t sys_msecs, void * params);
33 
37 typedef struct twTask {
39  uint64_t nextRunTick;
41 } twTask;
42 
51 void twTasker_Initialize();
52 
63 int twTasker_CreateTask(uint32_t runTimeIntervalMsec, twTaskFunction func);
64 
73 int twTasker_RemoveTask(int id);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif
int twTasker_RemoveTask(int id)
Removes a task from the tasker.
Definition: twTasker.c:60
Task structure definition.
Definition: twTasker.h:37
void twTasker_Initialize()
Initializes the tasker.
uint32_t runTimeIntervalMsec
Definition: twTasker.h:38
Default settings for ThingWorx C SDK.
int twTasker_CreateTask(uint32_t runTimeIntervalMsec, twTaskFunction func)
Adds a new task to the tasker.
Definition: twTasker.c:45
void(* twTaskFunction)(uint64_t sys_msecs, void *params)
Function signature of a task called in round robin fashion.
Definition: twTasker.h:32
uint64_t nextRunTick
Definition: twTasker.h:39
twTaskFunction func
Definition: twTasker.h:40
struct twTask twTask
Task structure definition.