summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-08-07 19:41:13 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-08-08 15:56:45 +0200
commit92f0e16392712fb80954426722675292d551bf0c (patch)
tree440d88cd84790ee4abc70692c47696f90ee638e3
parent060f6b9d62939600a787bba60bf8bf92a6dbc63f (diff)
Change-Id: I1f2b7484216271f97205cb9933bfd5ef2990bb2e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--signal-composer-binding/signal-composer.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/signal-composer-binding/signal-composer.cpp b/signal-composer-binding/signal-composer.cpp
index 7a111d5..79b6022 100644
--- a/signal-composer-binding/signal-composer.cpp
+++ b/signal-composer-binding/signal-composer.cpp
@@ -37,22 +37,6 @@ extern "C" void setSignalValueHandle(void* aSignal, uint64_t timestamp, json_obj
sig->set(timestamp, value);
}
-bool startsWith(const std::string& str, const std::string& pattern)
-{
- size_t sep;
- if( (sep = str.find(pattern)) != std::string::npos && !sep)
- {return true;}
- return false;
-}
-
-void extractString(void* closure, json_object* object)
-{
- std::vector<std::string> *files = (std::vector<std::string>*) closure;
- const char *oneFile = json_object_get_string(object);
-
- files->push_back(oneFile);
-}
-
// aSignal member value will be initialized in sourceAPI->addSignal()
static struct signalCBT pluginHandle = {
.searchNsetSignalValue = searchNsetSignalValueHandle,
@@ -389,14 +373,14 @@ void Composer::processOptions(const std::map<std::string, int>& opts, std::share
}
if (opts.at("maximum"))
{
- value = sig->minimum(opts.at("maximum"));
+ value = sig->maximum(opts.at("maximum"));
json_object_is_type(value, json_type_double) ?
json_object_object_add(response, "maximum", value) :
json_object_object_add(response, "error", value);
}
if (opts.at("last"))
{
- value = sig->minimum(opts.at("last"));
+ value = sig->last_value();
json_object_is_type(value, json_type_null) ?
json_object_object_add(response, "error", value) :
json_object_object_add(response, "last", value);