summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-05 16:51:25 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:49 +0100
commitfb487caec38c0da7a43bab850af6aa79b07befde (patch)
treeda3c46e3e8dcd4627fee54f784b391b284d373b5 /signal-composer-binding/source.cpp
parent2c3a3ca76a57efa1cd825d140fb26fdec3482ee8 (diff)
Hold all contexts (plugin & source) in signalCtx_
Keeping persistence between call data are kept in that member also subscription Action now use getSignals_ context and no more the signal one, this is more accurate and simples Change-Id: Idd7c56ba30f1daa9eaf9b99a7261d58189ef0bb2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/source.cpp')
-rw-r--r--signal-composer-binding/source.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index 6ad9511..3180513 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -113,11 +113,13 @@ void SourceAPI::makeSubscription()
break;
}
source.uid = sig.first.c_str();
- source.context = (void*)sig.second->get_context();
+ source.context = getSignals_->type == CTL_TYPE_CB ?
+ getSignals_->exec.cb.plugin->context:
+ nullptr;
ActionExecOne(&source, getSignals_, signalJ);
// Considerate signal subscribed no matter what
sig.second->subscribed_ = true;
- delete((struct signalCBT*)source.context);
+ json_object_put(signalJ);
}
source.uid = "";
ActionExecOne(&source, getSignals_, nullptr);