aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-16 16:31:59 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-11-23 09:59:57 +0100
commite1ef945da61ae0dfec7a5c8d1e9cde2716c0c1fd (patch)
tree43ebffa011d24f30f654f8914bc96d43cb3dce74 /signal-composer-binding/signal-composer-binding.cpp
parent71507d3afbb92f6751d6d7af5eeb1796ff13f246 (diff)
Binding migration to v3guppy_6.99.1guppy/6.99.16.99.1
Change-Id: I8a5bc18a0bf8ad05ce83b6ff64d4329d42bff2b0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer-binding.cpp')
-rw-r--r--signal-composer-binding/signal-composer-binding.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/signal-composer-binding/signal-composer-binding.cpp b/signal-composer-binding/signal-composer-binding.cpp
index 7d3391b..6c60526 100644
--- a/signal-composer-binding/signal-composer-binding.cpp
+++ b/signal-composer-binding/signal-composer-binding.cpp
@@ -20,8 +20,8 @@
// afb-utilities
#include <wrap-json.h>
#include <filescan-utils.h>
+#include <afb/afb-binding>
-#include "signal-composer-binding.hpp"
#include "signal-composer-apidef.h"
#include "clientApp.hpp"
@@ -74,7 +74,7 @@ void onEvent(const char *event, json_object *object)
}
}
-static int one_subscribe_unsubscribe(struct afb_req request,
+static int one_subscribe_unsubscribe(AFB_ReqT request,
bool subscribe,
const std::string& event,
json_object* args,
@@ -104,7 +104,7 @@ static int one_subscribe_unsubscribe(struct afb_req request,
return err;
}
-static int subscribe_unsubscribe(struct afb_req request,
+static int subscribe_unsubscribe(AFB_ReqT request,
bool subscribe,
json_object* args,
clientAppCtx* cContext)
@@ -133,7 +133,7 @@ static int subscribe_unsubscribe(struct afb_req request,
}
/// @brief entry point for client subscription request.
-static void do_subscribe_unsubscribe(afb_req request, bool subscribe, clientAppCtx* cContext)
+static void do_subscribe_unsubscribe(AFB_ReqT request, bool subscribe, clientAppCtx* cContext)
{
int rc = 0;
json_object *oneArg = nullptr, *args = afb_req_json(request);
@@ -157,24 +157,24 @@ static void do_subscribe_unsubscribe(afb_req request, bool subscribe, clientAppC
}
/// @brief entry point for client un-subscription request.
-void subscribe(afb_req request)
+void subscribe(AFB_ReqT request)
{
- clientAppCtx *cContext = reinterpret_cast<clientAppCtx*>(afb_req_context_make(request, 0, Composer::createContext, Composer::destroyContext, nullptr));
+ clientAppCtx *cContext = reinterpret_cast<clientAppCtx*>(afb_req_context(request, 0, Composer::createContext, Composer::destroyContext, nullptr));
do_subscribe_unsubscribe(request, true, cContext);
}
/// @brief entry point for client un-subscription request.
-void unsubscribe(afb_req request)
+void unsubscribe(AFB_ReqT request)
{
- clientAppCtx *cContext = reinterpret_cast<clientAppCtx*>(afb_req_context_make(request, 0, Composer::createContext, Composer::destroyContext, nullptr));
+ clientAppCtx *cContext = reinterpret_cast<clientAppCtx*>(afb_req_context(request, 0, Composer::createContext, Composer::destroyContext, nullptr));
do_subscribe_unsubscribe(request, false, cContext);
}
/// @brief verb that loads JSON configuration (old SigComp.json file now)
-void addObjects(afb_req request)
+void addObjects(AFB_ReqT request)
{
Composer& composer = Composer::instance();
json_object *sourcesJ = nullptr,
@@ -244,7 +244,7 @@ void addObjects(afb_req request)
}
/// @brief entry point to list available signals
-void list(afb_req request)
+void list(AFB_ReqT request)
{
struct json_object *allSignalsJ = json_object_new_array();
@@ -259,7 +259,7 @@ void list(afb_req request)
}
/// @brief entry point for get requests.
-void get(struct afb_req request)
+void get(AFB_ReqT request)
{
int err = 0, i = 0;
size_t l = 0;
@@ -295,22 +295,22 @@ void get(struct afb_req request)
}
-int loadConf()
+int loadConf(AFB_ApiT api)
{
int err = 0;
std::string bindingDirPath = GetBindingDirPath();
std::string rootdir = bindingDirPath + "/etc";
- err = Composer::instance().loadConfig(rootdir);
+ err = Composer::instance().loadConfig(api, rootdir);
return err;
}
-int execConf()
+int execConf(AFB_ApiT api)
{
Composer& composer = Composer::instance();
int err = 0;
- CtlConfigExec(nullptr, composer.ctlConfig());
+ CtlConfigExec(api, composer.ctlConfig());
AFB_DEBUG("Signal Composer Control configuration Done.");