From 24057b7fad6d4d1f1f264995d0f5865acf466004 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Sun, 12 Mar 2017 19:38:49 +0100 Subject: Make diagnostic manager initialization processus. It is initiliazed with by default the first CAN bus device in the CAN bus device list from CAN bus manager. The object is instancied at configuration_t object first invokation and after all CAN buses has been initialized then the diag manager is initialized too. Change-Id: I4894f2c62f575676c34efec3608b97de8c5326e1 Signed-off-by: Romain Forlot --- src/low-can-binding.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/low-can-binding.cpp') diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp index a2b54567..394d906a 100644 --- a/src/low-can-binding.cpp +++ b/src/low-can-binding.cpp @@ -223,13 +223,17 @@ extern "C" { can_bus_t& can_bus_manager = configuration_t::instance().get_can_bus_manager(); - /* Open CAN socket */ + /// Initialize CAN socket if(can_bus_manager.init_can_dev() == 0) { can_bus_manager.start_threads(); 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()); + ERROR(binder_interface, "There was something wrong with CAN device Initialization. Check your config file maybe"); return 1; } -- cgit 1.2.3-korg