diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-14 10:48:07 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:15:55 +0100 |
commit | 83f0501dbb4cd2f2baf8c164728334a0142ec94d (patch) | |
tree | c54619fb6f53afacabc7c0b0e1c116140622c15b /src/low-can-binding.cpp | |
parent | 665f905386a0362657888db5e3a213a1c03f72ee (diff) |
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r-- | src/low-can-binding.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp index f6e9849f..0c26595b 100644 --- a/src/low-can-binding.cpp +++ b/src/low-can-binding.cpp @@ -25,7 +25,6 @@ #include <time.h> #include <linux/can.h> #include <json-c/json.h> -#include <systemd/sd-event.h> #include "openxc.pb.h" #include "configuration.hpp" @@ -42,8 +41,6 @@ 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; @@ -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<std::string>& 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); |