diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-09-26 18:36:47 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-14 11:00:25 +0100 |
commit | c22ad857bcd2f567d22f3239d91fa65720718713 (patch) | |
tree | 165407be42745a190672ff64fe27503074380735 /signal-composer-binding | |
parent | 7f5a4ef3053eaac5c3f936b6294087d3d2b72c38 (diff) |
lua2c completely operationnal
- Retrieve args from lua call correctly
- Correctly push and set function pointer into plugin
symbols
Change-Id: I12d03e1101c458a042887a67a35a08082bd98f4c
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding')
-rw-r--r-- | signal-composer-binding/signal-composer-binding.cpp | 1 | ||||
-rw-r--r-- | signal-composer-binding/signal-composer.cpp | 10 | ||||
-rw-r--r-- | signal-composer-binding/signal.hpp | 5 |
3 files changed, 9 insertions, 7 deletions
diff --git a/signal-composer-binding/signal-composer-binding.cpp b/signal-composer-binding/signal-composer-binding.cpp index 3c16ad3..36d0c9d 100644 --- a/signal-composer-binding/signal-composer-binding.cpp +++ b/signal-composer-binding/signal-composer-binding.cpp @@ -32,7 +32,6 @@ /// @param[in] object - eventual data that comes with the event void onEvent(const char *event, json_object *object) { - AFB_NOTICE("Received event json: %s", json_object_to_json_string(object)); Composer& composer = Composer::instance(); std::vector<std::shared_ptr<Signal>> signals = composer.searchSignals(event); diff --git a/signal-composer-binding/signal-composer.cpp b/signal-composer-binding/signal-composer.cpp index f0a625b..89d442d 100644 --- a/signal-composer-binding/signal-composer.cpp +++ b/signal-composer-binding/signal-composer.cpp @@ -21,15 +21,13 @@ #include "clientApp.hpp" -extern "C" void setsignalValueHandle(const char* aName, long long int timestamp, struct signalValue value) +extern "C" void setSignalValueHandle(const char* aName, uint64_t timestamp, struct signalValue value) { std::vector<std::shared_ptr<Signal>> signals = Composer::instance().searchSignals(aName); if(!signals.empty()) { for(auto& sig: signals) - { - sig->set(timestamp, value); - } + {sig->set(timestamp, value);} } } @@ -41,8 +39,8 @@ bool startsWith(const std::string& str, const std::string& pattern) return false; } -static struct pluginCBT pluginHandle = { - .setsignalValue = setsignalValueHandle, +static struct signalCBT pluginHandle = { + .setSignalValue = setSignalValueHandle, }; CtlSectionT Composer::ctlSections_[] = { diff --git a/signal-composer-binding/signal.hpp b/signal-composer-binding/signal.hpp index 7bc6b4a..aa974da 100644 --- a/signal-composer-binding/signal.hpp +++ b/signal-composer-binding/signal.hpp @@ -86,3 +86,8 @@ public: int initialRecursionCheck(); int recursionCheck(Signal* obs); }; + +struct signalCBT +{ + void (*setSignalValue)(const char* aName, uint64_t timestamp, struct signalValue value); +}; |