diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-07-21 00:48:25 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-07-26 10:19:45 +0200 |
commit | 7df6f7dd70ffc7f073e466cc7e3788276c148e2e (patch) | |
tree | ba24969bbc24e67373eee536d90c036e5ee37ab4 /src/mapis.c | |
parent | 8533667c1b70c216aa5c2c18c5fa391490fecc09 (diff) |
DynAPI > V3 migration of afb-test binding.
Controller is still using dynapi and preV3 version.
This is a preparation for future controller update to V3
Submodule app-controller-submodule 88892db..b79a761:
> Split loading JSON controller file.
> Release arguments once C function returned.
> Fix : typo introduced in a previous commit.
> Fixed character counting that was shortening paths
> Keep json unmodified during action execution
Change-Id: Iba37b3fbd35e58973b9601a7f91bfdb61abcf76f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/mapis.c')
-rw-r--r-- | src/mapis.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mapis.c b/src/mapis.c index 64543e5..0c2a4aa 100644 --- a/src/mapis.c +++ b/src/mapis.c @@ -32,7 +32,7 @@ static int LoadOneMapi(void *data, AFB_ApiT apiHandle) { int savedCount = 0, count = 0, idx = 0; CtlActionT *savedActions = NULL, *newActions = NULL; struct mapisHandleT *mapisHandle = (struct mapisHandleT*)data; - CtlConfigT *ctrlConfig = afb_dynapi_get_userdata(mapisHandle->mainApiHandle); + CtlConfigT *ctrlConfig = afb_api_get_userdata(mapisHandle->mainApiHandle); if(PluginConfig(apiHandle, mapisHandle->section, mapisHandle->mapiJ)) { AFB_ApiError(apiHandle, "Problem loading the plugin as an API for %s, see log message above", json_object_get_string(mapisHandle->mapiJ)); @@ -83,7 +83,7 @@ static int LoadOneMapi(void *data, AFB_ApiT apiHandle) { ctrlConfig->sections[idx].actions = mergedActions; // declare an event event manager for this API; - afb_dynapi_on_event(apiHandle, CtrlDispatchApiEvent); + afb_api_on_event(apiHandle, CtrlDispatchApiEvent); return 0; } @@ -112,7 +112,7 @@ static void OneMapiConfig(void *data, json_object *mapiJ) { json_object_object_del(mapiJ, "events"); mapisHandle->mapiJ = mapiJ; - if (afb_dynapi_new_api(mapisHandle->mainApiHandle, uid, info, 1, LoadOneMapi, (void*)mapisHandle)) { + if (afb_api_new_api(mapisHandle->mainApiHandle, uid, info, 1, LoadOneMapi, (void*)mapisHandle)) { AFB_ApiError(mapisHandle->mainApiHandle, "Error creating new api: %s", uid); return; } |