aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-22 01:13:17 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-25 10:08:07 +0200
commit7f15ef65f420179b606f136ed805fae9d320b321 (patch)
treec4ef2dde841415ce4dedcaaa5f0edf7e258bc356 /signal-composer-binding/signal-composer-binding.cpp
parent3b08cec1ad06f313374bc1fd9cc64e1b28ce798d (diff)
Improved performance
Before value was translated to a C type variable two times, at the reception then at the emission. Now it just receives and sends the signal value without translation nor interpretation except if you ask for an average, minimum or maximum value. Then in those cases it interprets the json to return you a value or an error if there is no numeric values to compute. Remove unneeded log message at event reception. Improved signal search engine, will search in source's signals map by the signal ID not the event name which lead to a more direct map match. Bugs-AGL: SPEC-1612 Depends-On: I43e79ed73a507ac2ca7ed4cdc3f16ec009392194 Change-Id: Ie253c3fe1e8cde42dabe8832da74e9f9bf442c14 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer-binding.cpp')
-rw-r--r--signal-composer-binding/signal-composer-binding.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/signal-composer-binding/signal-composer-binding.cpp b/signal-composer-binding/signal-composer-binding.cpp
index 0d9c8e3..f7c8c73 100644
--- a/signal-composer-binding/signal-composer-binding.cpp
+++ b/signal-composer-binding/signal-composer-binding.cpp
@@ -32,10 +32,8 @@
/// @param[in] object - eventual data that comes with the event
void onEvent(const char *event, json_object *object)
{
- Composer& composer = Composer::instance();
- AFB_NOTICE("event: %s", json_object_to_json_string(object));
+ std::vector<std::shared_ptr<Signal>> signals { Composer::instance().searchSignals(event) };
- std::vector<std::shared_ptr<Signal>> signals = composer.searchSignals(event);
if(!signals.empty())
{
// If there is more than 1 element then maybe we can find a more