summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-12 19:38:49 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:41 +0100
commit24057b7fad6d4d1f1f264995d0f5865acf466004 (patch)
treeced9c92076a3f6c1e87f9aeb0312bfa2440fd3a1 /src/low-can-binding.cpp
parent62eb024d989037ae7f2ba86de8b68c826cb61ec9 (diff)
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp6
1 files changed, 5 insertions, 1 deletions
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;
}