aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-10-05 01:38:18 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit8df3e437f941912067231250ff5695b8a3a7fd92 (patch)
treec812fb252ad0f8a48041aff28b7fc60a75f245d1 /signal-composer-binding/source.cpp
parent8364673ab93eb484e25c7c4776e5d705b73330b4 (diff)
LUA lib and bin embedded in project
Change-Id: I1a61b49f55e4daa305800e754a14b6041aa81b34 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/source.cpp')
-rw-r--r--signal-composer-binding/source.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index d1b2120..4511fa7 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -52,6 +52,20 @@ void SourceAPI::addSignal(const std::string& id, const std::string& event, std::
{
std::shared_ptr<Signal> sig = std::make_shared<Signal>(id, event, depends, unit, retention, frequency, onReceived, getSignalsArgs);
+ if(onReceived)
+ {
+ struct signalCBT* ctx = onReceived->source.context ?
+ (struct signalCBT*)onReceived->source.context :
+ (struct signalCBT*)calloc (1, sizeof(struct signalCBT));
+ if(!ctx->searchNsetSignalValue)
+ {ctx->searchNsetSignalValue = searchNsetSignalValueHandle;}
+ if(!ctx->setSignalValue)
+ {ctx->setSignalValue = setSignalValueHandle;}
+
+ ctx->aSignal = (void*)sig.get();
+ onReceived->source.context = (void*)ctx;
+ }
+
signalsMap_[id] = sig;
}