aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-timer.h
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-11-02 11:58:32 +0100
committerRonan Le Martret <ronan.lemartret@iot.bzh>2017-11-24 10:37:52 +0100
commit3e6dbb17336cade4abf270193c164ea60b7b8389 (patch)
treefbb15fa89b8a98ba5a43565b98cb91c3253b65f3 /ctl-lib/ctl-timer.h
parent12dc78f18e54b92332ddd33c785b0d1e0352410b (diff)
Modifiy timer to supper DynAPI
th Please enter the commit message for your changes. Lines starting Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-timer.h')
-rw-r--r--ctl-lib/ctl-timer.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/ctl-lib/ctl-timer.h b/ctl-lib/ctl-timer.h
index 6256dcc..333f172 100644
--- a/ctl-lib/ctl-timer.h
+++ b/ctl-lib/ctl-timer.h
@@ -23,7 +23,6 @@
// ctl-timer.c
// ----------------------
-typedef int (*timerCallbackT)(void *context);
typedef struct TimerHandleS {
int magic;
@@ -31,12 +30,14 @@ typedef struct TimerHandleS {
int delay;
const char*uid;
void *context;
- timerCallbackT callback;
sd_event_source *evtSource;
AFB_ApiT api;
- timerCallbackT freeCB;
+ int (*callback) (struct TimerHandleS *handle);
+ int (*freeCB) (void *context) ;
} TimerHandleT;
+typedef int (*timerCallbackT)(TimerHandleT *context);
+
PUBLIC int TimerEvtInit (AFB_ApiT apiHandle);
PUBLIC void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCallbackT callback, void *context);
PUBLIC void TimerEvtStop(TimerHandleT *timerHandle);