diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-31 17:01:54 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-01 18:26:18 +0200 |
commit | 6c988cacd4fa284b0effb12e65c76502565c4248 (patch) | |
tree | 5da33ffb297ba8926e7ce0f70d2dc8f92b07ccb2 /CAN-binder/low-can-binding/can/can-signals.cpp | |
parent | 84f7395a94048df10fe88a41d6a43fdbc8f5785c (diff) |
Retrieve signal last value and timestamp at once.
Change-Id: I8401030ece94b5e397b6d2b71b29ff4e435d1486
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-signals.cpp')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-signals.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CAN-binder/low-can-binding/can/can-signals.cpp b/CAN-binder/low-can-binding/can/can-signals.cpp index 260d5775..fe74115c 100644 --- a/CAN-binder/low-can-binding/can/can-signals.cpp +++ b/CAN-binder/low-can-binding/can/can-signals.cpp @@ -165,11 +165,17 @@ bool can_signal_t::get_received() const { return received_; } + float can_signal_t::get_last_value() const { return last_value_; } +std::pair<float, uint64_t> can_signal_t::get_last_value_with_timestamp() const +{ + return std::make_pair(last_value_, frequency_.get_last_tick()); +} + void can_signal_t::set_parent(can_message_definition_t* parent) { parent_ = parent; |