aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-04-24 15:08:22 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-05 15:43:09 +0200
commit27776f5a89ba71cb102e5c2e08b813025c55c663 (patch)
treeb345853eea5e436f6021d3dcdd01a587dcee3429 /signal-composer-binding/source.cpp
parent4e68c9f6d3b303dd326a42e69556b22e0fe88438 (diff)
Use signal subscription args if present
By default subscription argument request from signal are passed if present, else the one from the signal's source if present. If nothing is specified for sources then argument is set as a NULL pointer. Change-Id: I18db0a9922039f41d475cd08758a2afd4acaa9d4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/source.cpp')
-rw-r--r--signal-composer-binding/source.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index f34b88f..6832320 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -149,6 +149,7 @@ void SourceAPI::makeSubscription()
source.uid = api_.c_str();
source.api = nullptr; // We use binding v2, no dynamic API.
source.request = {nullptr, nullptr};
+ json_object *argsSaveJ = getSignals_->argsJ;
for(auto& sig: signalsM_)
{
@@ -162,15 +163,18 @@ void SourceAPI::makeSubscription()
}
source.uid = sig.first.c_str();
source.context = getSignals_->type == CTL_TYPE_CB ?
- getSignals_->exec.cb.plugin->context:
+ getSignals_->exec.cb.plugin->context :
nullptr;
+ getSignals_->argsJ = sig.second->getSignalsArgs() ?
+ sig.second->getSignalsArgs() :
+ argsSaveJ;
ActionExecOne(&source, getSignals_, signalJ);
// Considerate signal subscribed no matter what
sig.second->subscribed_ = true;
- json_object_put(signalJ);
}
}
- source.uid = "";
+ getSignals_->argsJ = argsSaveJ;
+ source.uid = uid_.c_str();
ActionExecOne(&source, getSignals_, nullptr);
}
}