aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-10-27 15:14:38 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-10-27 15:18:27 +0200
commit1676c44575792a53b1a6144059b664590f9dfad7 (patch)
tree13d4c2eacc4d1ba7c532a468eb801e483eefaf91
parent421ac118bf0dff35533421b8171444d6cf419023 (diff)
Fix issue with compiling in API-V2
-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);