From 5e919fde0a4c66b0203c46b8f06f303fcceaedde Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Thu, 17 Aug 2017 00:56:43 +0200 Subject: Implemented Timer and Event from Lua --- Controler-afb/ctl-binding.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Controler-afb/ctl-binding.h') diff --git a/Controler-afb/ctl-binding.h b/Controler-afb/ctl-binding.h index 33a9049..c998007 100644 --- a/Controler-afb/ctl-binding.h +++ b/Controler-afb/ctl-binding.h @@ -24,6 +24,8 @@ #include #include #include +#include + #ifdef CONTROL_SUPPORT_LUA #include "lua.h" @@ -46,9 +48,22 @@ PUBLIC int CtlBindingInit (); // ctl-timerevt.c // ---------------------- +typedef int (*timerCallbackT)(void *context); + +typedef struct TimerHandleS { + int count; + int delay; + const char*label; + void *context; + timerCallbackT callback; + sd_event_source *evtSource; +} TimerHandleT; + PUBLIC int TimerEvtInit (void); PUBLIC afb_event TimerEvtGet(void); PUBLIC void ctlapi_event_test (afb_req request); +PUBLIC void TimerEvtStart(TimerHandleT *timerHandle, timerCallbackT callback, void *context); +PUBLIC void TimerEvtStop(TimerHandleT *timerHandle); // ctl-policy // ----------- -- cgit 1.2.3-korg