aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--signal-composer-binding/signal.cpp8
-rw-r--r--signal-composer-binding/signal.hpp1
-rw-r--r--signal-composer-binding/source.cpp10
3 files changed, 16 insertions, 3 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp
index 84be8a7..d10dda6 100644
--- a/signal-composer-binding/signal.cpp
+++ b/signal-composer-binding/signal.cpp
@@ -178,6 +178,14 @@ struct signalCBT* Signal::get_context()
return &signalCtx_;
}
+/// @brief Accessor to getSignalsArgs_ json_object member
+///
+/// @return a pointer the json_object getSignalsArgs_ private member
+json_object *Signal::getSignalsArgs()
+{
+ return getSignalsArgs_;
+}
+
/// @brief Set Signal timestamp and value property when an incoming
/// signal arrived. Called by a plugin because treatment can't be
/// standard as signals sources format could changes. See low-can plugin
diff --git a/signal-composer-binding/signal.hpp b/signal-composer-binding/signal.hpp
index 5b35065..c825b37 100644
--- a/signal-composer-binding/signal.hpp
+++ b/signal-composer-binding/signal.hpp
@@ -103,6 +103,7 @@ public:
const std::string id() const;
json_object* toJSON() const;
struct signalCBT* get_context();
+ json_object *getSignalsArgs();
void set(uint64_t timestamp, struct signalValue& value);
void update(Signal* sig);
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);
}
}