From 542518e3f4390fcb0d8fb17bcbb14c7eb4335a61 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 13 Mar 2017 15:03:00 +0100 Subject: Move member from obd2_signals_t class to active_diagnostic_request_t (adr)class. It's more logical to have them here as call about incoming diagnostic CAN messages are made against adr class not obd2_signal_t that it's a subset of diagnostic messages. It's made to handle obd2 requests as well as normal UDS diagnostic request for constructor proprietary diagnostic signals. Change-Id: I96c714640d6ecfa25dfc9942974057c1797eb0e1 Signed-off-by: Romain Forlot --- src/low-can-binding.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/low-can-binding.cpp') diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp index 0c418fe..8ecf742 100644 --- a/src/low-can-binding.cpp +++ b/src/low-can-binding.cpp @@ -132,7 +132,7 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, for(const std::string& sig : signals) { int ret; - if (obd2_signal_t::is_obd2_signal(sig)) + if (active_diagnostic_request_t::is_diagnostic_signal(sig)) { std::vector found; configuration_t::instance().find_obd2_signals(build_DynamicField(sig), found); @@ -252,9 +252,10 @@ extern "C" return 0; } - /// Initialize Diagnostic manager that will handle obd2 requests - diagnostic_manager_t& diag_manager = configuration_t::instance().get_diagnostic_manager(); - diag_manager.initialize(can_bus_manager.get_can_devices().front()); + /// Initialize Diagnostic manager that will handle obd2 requests. + /// We pass by default the first CAN bus device to its Initialization. + /// TODO: be able to choose the CAN bus device that will be use as Diagnostic bus. + configuration_t::instance().get_diagnostic_manager().initialize(can_bus_manager.get_can_devices().front()); ERROR(binder_interface, "There was something wrong with CAN device Initialization. Check your config file maybe"); return 1; -- cgit 1.2.3-korg