aboutsummaryrefslogtreecommitdiffstats
path: root/Controler-afb/ctl-binding.h
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-08-17 00:56:43 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-08-17 00:56:43 +0200
commit5e919fde0a4c66b0203c46b8f06f303fcceaedde (patch)
tree6e4937b46d7370e9c8abe1f9a829759deda75ba2 /Controler-afb/ctl-binding.h
parenta4899ab57f08aeb2741d08f74d7593c85a0ad3f4 (diff)
Implemented Timer and Event from Lua
Diffstat (limited to 'Controler-afb/ctl-binding.h')
-rw-r--r--Controler-afb/ctl-binding.h15
1 files changed, 15 insertions, 0 deletions
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 <json-c/json.h>
#include <filescan-utils.h>
#include <wrap-json.h>
+#include <systemd/sd-event.h>
+
#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
// -----------