summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-01 00:00:27 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-05 16:22:47 +0200
commit01de7c310b4e6846107b4e6f9a0f4d2a7db7af86 (patch)
tree5982ef17586cc9d120f9d111a9295c62f9a0fb1b /signal-composer-binding/signal.cpp
parent3e45dda1b12578c9d84b7a4f479e2a9fbaaa5d3b (diff)
Return separately last timestamp and value
Last timestamp and value is those ones directly store as object's attributes not the last from the history. Simple... Change-Id: Id2c808a1b236dfa36821cf9fc5a5bcd6a4114f10 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.cpp')
-rw-r--r--signal-composer-binding/signal.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp
index ecba162..577d94c 100644
--- a/signal-composer-binding/signal.cpp
+++ b/signal-composer-binding/signal.cpp
@@ -485,14 +485,12 @@ double Signal::maximum(int seconds) const
/// @return Last value
struct signalValue Signal::last_value() const
{
- if(history_.empty()) {return signalValue();}
- return history_.rbegin()->second;
+ return value_;
}
uint64_t Signal::last_timestamp() const
{
- if(history_.empty()) {return 0;}
- return history_.rbegin()->first;
+ return timestamp_;
}
/// @brief Recursion check to ensure that there is no infinite loop