From 83f0501dbb4cd2f2baf8c164728334a0142ec94d Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 14 Mar 2017 10:48:07 +0100 Subject: Move diagnostic requests scheduling to diagnostic manager while adding the request. It is more logic to make that here than in the subscription operation. Change-Id: I19b29bc11c5fb6e5828a0bf189fac1333b0199ed Signed-off-by: Romain Forlot --- src/low-can-binding.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/low-can-binding.cpp') diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp index f6e9849..0c26595 100644 --- a/src/low-can-binding.cpp +++ b/src/low-can-binding.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include "openxc.pb.h" #include "configuration.hpp" @@ -42,8 +41,6 @@ extern "C" #include }; -#define MICRO 1000000 - // Interface between the daemon and the binding const struct afb_binding_interface *binder_interface; @@ -124,7 +121,6 @@ static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe, static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, const std::vector& signals) { int rets = 0; - sd_event_source *source; //TODO: Implement way to dynamically call the right function no matter // how much signals types we have. @@ -141,9 +137,6 @@ 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*MICRO, 0, - configuration_t::instance().get_diagnostic_manager().send_request, diag_req); - sd_event_source_set_enabled(source, SD_EVENT_ON); } ret = subscribe_unsubscribe_signal(request, subscribe, sig); -- cgit 1.2.3-korg