summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding
diff options
context:
space:
mode:
Diffstat (limited to 'signal-composer-binding')
-rw-r--r--signal-composer-binding/signal-composer.cpp13
-rw-r--r--signal-composer-binding/signal-composer.hpp7
2 files changed, 19 insertions, 1 deletions
diff --git a/signal-composer-binding/signal-composer.cpp b/signal-composer-binding/signal-composer.cpp
index 8ad8c3b..b29df22 100644
--- a/signal-composer-binding/signal-composer.cpp
+++ b/signal-composer-binding/signal-composer.cpp
@@ -19,10 +19,21 @@
#include "signal-composer.hpp"
+extern "C" void setSignalValueHandle(const char* aName, long long int timestamp, struct SignalValue value)
+{
+ std::shared_ptr<Signal> sig = bindingApp::instance().searchSignal(aName);
+ if(sig)
+ {sig->set(timestamp, value);}
+}
+
+static struct pluginCBT pluginHandle = {
+ .setSignalValue = setSignalValueHandle,
+};
+
CtlSectionT bindingApp::ctlSections_[] = {
[0]={.key="plugins" ,.label = "plugins", .info=nullptr,
.loadCB=PluginConfig,
- .handle=&bindingApp::instance()},
+ .handle=&pluginHandle},
[1]={.key="sources" ,.label = "sources", .info=nullptr,
.loadCB=loadSourcesAPI,
.handle=nullptr},
diff --git a/signal-composer-binding/signal-composer.hpp b/signal-composer-binding/signal-composer.hpp
index 2c7c2e2..341eaab 100644
--- a/signal-composer-binding/signal-composer.hpp
+++ b/signal-composer-binding/signal-composer.hpp
@@ -55,3 +55,10 @@ public:
int execSubscription() const;
};
+
+struct pluginCBT
+{
+ void (*setSignalValue)(const char* aName, long long int timestamp, struct SignalValue value);
+};
+
+extern "C" void setSignalValueHandle(const char* aName, long long int timestamp, struct SignalValue value);