aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-10-27 15:14:38 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:54 +0100
commit120d04e6a71e54319e3fc0c40346eb828bdd45d3 (patch)
tree13d4c2eacc4d1ba7c532a468eb801e483eefaf91 /ctl-lib
parentcfed79e853100948cc14e4af034108400f4e4d6d (diff)
Fix issue with compiling in API-V2
Diffstat (limited to 'ctl-lib')
-rw-r--r--ctl-lib/ctl-lua.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index 4d32794..cd5d292 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -416,7 +416,11 @@ STATIC int LuaAfbFail(lua_State* luaState) {
return 1;
}
+#ifdef AFB_BINDING_PREV3
STATIC void LuaAfbServiceCB(void *handle, int iserror, struct json_object *responseJ, AFB_ApiT apiHandle) {
+#else
+STATIC void LuaAfbServiceCB(void *handle, int iserror, struct json_object *responseJ) {
+#endif
LuaCbHandleT *handleCb= (LuaCbHandleT*)handle;
int count=1;
@@ -914,8 +918,11 @@ STATIC int LuaTimerClear (lua_State* luaState) {
// retrieve useful information opaque handle
TimerHandleT *timerHandle = LuaTimerPop(luaState, LUA_FIST_ARG);
if (!timerHandle) goto OnErrorExit;
+
+#ifdef AFB_BINDING_PREV3
+ // API handle does not exit in API-V2
LuaCbHandleT *luaCbHandle = (LuaCbHandleT*) timerHandle->context;
-
+#endif
AFB_ApiNotice (luaCbHandle->source->api,"LuaTimerClear timer=%s", timerHandle->uid);
TimerEvtStop(timerHandle);