40 #ifndef CASCODA_TASKLET_H
41 #define CASCODA_TASKLET_H
Global error declarations for use across the Cascoda SDK.
ca_error TASKLET_Init(ca_tasklet *aTasklet, ca_tasklet_callback aCallback)
Initialise a tasklet to a stable state, and register its associated callback function.
Definition: cascoda_tasklet.c:59
struct ca_tasklet ca_tasklet
Internal tasklet state structure.
ca_error(* ca_tasklet_callback)(void *context)
Function pointer typedef for tasklet callbacks.
Definition: cascoda_tasklet.h:58
ca_error TASKLET_GetScheduledTime(ca_tasklet *aTasklet, uint32_t *aTimeAbs)
Get the time that the tasklet is scheduled to be called.
Definition: cascoda_tasklet.c:110
bool TASKLET_IsQueued(ca_tasklet *aTasklet)
Query whether a tasklet is currently scheduled.
Definition: cascoda_tasklet.c:157
ca_error TASKLET_Process(void)
Process the callbacks for any tasklets that are scheduled to happen now or in the past.
Definition: cascoda_tasklet.c:175
ca_error TASKLET_GetScheduledTimeDelta(ca_tasklet *aTasklet, uint32_t *aTimeDelta)
Get the time delta until a tasklet is scheduled to be called.
Definition: cascoda_tasklet.c:119
ca_error TASKLET_Cancel(ca_tasklet *aTasklet)
Cancel a scheduled tasklet if it is scheduled.
Definition: cascoda_tasklet.c:128
ca_error TASKLET_GetTimeToNext(uint32_t *aTimeDelta)
Get the time delta until the next tasklet is scheduled to occur.
Definition: cascoda_tasklet.c:162
ca_error TASKLET_ScheduleAbs(ca_tasklet *aTasklet, uint32_t aTimeNow, uint32_t aTimeAbs, void *aContext)
Schedule a tasklet to be called in the future, at aTimeAbs milliseconds.
Definition: cascoda_tasklet.c:76
ca_error TASKLET_ScheduleDelta(ca_tasklet *aTasklet, uint32_t aTimeDelta, void *aContext)
Schedule a tasklet to be called in the future, by aTimeDelta milliseconds.
Definition: cascoda_tasklet.c:70
ca_error
Cascoda error type.
Definition: ca821x_error.h:51
Internal tasklet state structure.
Definition: cascoda_tasklet.h:66
uint8_t scheduled
Internal: Is this tasklet scheduled?
Definition: cascoda_tasklet.h:71
uint32_t fireTime
Internal: The next time at which the tasklet is due to trigger.
Definition: cascoda_tasklet.h:70
void * context
Internal: The context that will be passed to the callback when it is called.
Definition: cascoda_tasklet.h:68
struct ca_tasklet * next
Internal: The next tasklet in the sorted tasklet linkedlist.
Definition: cascoda_tasklet.h:69
ca_tasklet_callback callback
Internal: The callback that will be called when the tasklet is triggered.
Definition: cascoda_tasklet.h:67