summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-13 09:18:34 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:14:37 +0100
commitd67146a15dad49d28bea92891cff1a8489534aa5 (patch)
tree0a9e661c77744f9c4b1eb8d25f89e8cad5fe4add /src/low-can-binding.cpp
parent228220efbde99b38ff29a9f58f59ba5c62aedfe6 (diff)
Fix: set to microsecond frequency check of diag request
Change-Id: I871ff68afd7f398d4c7d3a550c8926c1f7e67cb3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index 23ab2da7..e7d8530f 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -42,6 +42,8 @@ extern "C"
#include <afb/afb-service-itf.h>
};
+#define MICRO 1000000
+
// Interface between the daemon and the binding
const struct afb_binding_interface *binder_interface;
@@ -141,7 +143,7 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
configuration_t::instance().get_diagnostic_manager().add_recurring_request(
diag_req, sig.c_str(), false, obd2_signal_t::decode_obd2_response, nullptr, (float)frequency);
//TODO: Adding callback requesting ignition status: diag_req, sig.c_str(), false, obd2_signal_t::decode_obd2_response, obd2_signal_t::check_ignition_status, frequency);
- sd_event_add_time(afb_daemon_get_event_loop(binder_interface->daemon), &source, CLOCK_MONOTONIC, frequency, 0,
+ sd_event_add_time(afb_daemon_get_event_loop(binder_interface->daemon), &source, CLOCK_MONOTONIC, frequency*MICRO, 0,
configuration_t::instance().get_diagnostic_manager().send_request, diag_req);
}