aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal.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.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.cpp')
-rw-r--r--signal-composer-binding/signal.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp
index b77ab59..98eddf1 100644
--- a/signal-composer-binding/signal.cpp
+++ b/signal-composer-binding/signal.cpp
@@ -229,12 +229,13 @@ void Signal::set(uint64_t timestamp, json_object*& value)
void Signal::update(Signal* sig)
{
json_object *depSigJ = json_object_new_array();
- CtlSourceT src = {
- .uid = sig->id().c_str(),
- .api = nullptr,
- .request = {nullptr, nullptr},
- .context = (void*)get_context(),
- .status = CTL_STATUS_EVT};
+ CtlSourceT source;
+ ::memset(&source, 0, sizeof(CtlSourceT));
+ source.uid = sig->id().c_str();
+ source.api = afbBindingV3root;
+ source.context = (void*)get_context();
+ source.status = CTL_STATUS_EVT ;
+
Composer& composer = Composer::instance();
for(const std::string& depSignal : dependsSigV_)
@@ -247,7 +248,7 @@ void Signal::update(Signal* sig)
}
json_object_array_add(depSigJ, sig->toJSON());
- ActionExecOne(&src, onReceived_, depSigJ);
+ ActionExecOne(&source, onReceived_, depSigJ);
}
/// @brief
@@ -323,9 +324,8 @@ void Signal::onReceivedCB(json_object *eventJ)
}
CtlSourceT source;
+ ::memset(&source, 0, sizeof(CtlSourceT));
source.uid = id_.c_str();
- source.api = nullptr; // We use binding v2, no dynamic API.
- source.request = {nullptr, nullptr};
source.context = (void*)get_context();
if (onReceived_)
ActionExecOne(&source, onReceived_, json_object_get(eventJ));