summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/utils/timer.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-16 00:26:24 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-19 11:36:42 +0200
commitc59a57338a488cc451482f1180fe672e7d5c9179 (patch)
tree3d1ffca26c1e824be79309a5fea829a785e110a3 /CAN-binder/low-can-binding/utils/timer.hpp
parentefc7297476bfee786e6f69800552ca03e20d128d (diff)
New function used to set timer in bcm_head msg.
As there will be more bcm socket and more need to set its timer values. May be there is a better method to separate integer and decimal parts from a float value. Change-Id: I0cd992dfde5fe8257b17b5b610482f5f5e09aa8c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/utils/timer.hpp')
-rw-r--r--CAN-binder/low-can-binding/utils/timer.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/CAN-binder/low-can-binding/utils/timer.hpp b/CAN-binder/low-can-binding/utils/timer.hpp
index f5659044..d3fedbdf 100644
--- a/CAN-binder/low-can-binding/utils/timer.hpp
+++ b/CAN-binder/low-can-binding/utils/timer.hpp
@@ -17,6 +17,8 @@
#pragma once
+#include <sys/time.h>
+
/// @brief return epoch in milliseconds
///
/// @return long long int epoch in milliseconds
@@ -43,6 +45,7 @@ public:
frequency_clock_t(float frequency, unsigned long last_tick, time_function_t time_function);
float get_frequency() const;
+ const struct timeval get_timeval_from_period() const;
float frequency_to_period();
bool started();