summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-20 09:08:12 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-20 09:08:12 +0000
commitc0fd6e1982353d056c26a292186ef0df315adde3 (patch)
tree6dce1b1866aab81b660aaae554c8f16c53f0d2d5 /src/low-can-binding.cpp
parentd99b87ba4332fd0c1e51d2708e46c52bad713558 (diff)
Fix: Avoid segfault if diagnostic bus isn't correctly set.
There is a segfault when binding configuration doesn't matches configuration generated. Improve general CAN bus device initialization. Change-Id: I17ea94ee54841d09ac63a7ffad303a88d99e0173 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index 3e870721..45213d91 100644
--- a/src/low-can-binding.cpp
+++ b/src/low-can-binding.cpp
@@ -255,13 +255,15 @@ extern "C"
/// Initialize CAN socket
if(can_bus_manager.init_can_dev() == 0)
+ {
can_bus_manager.start_threads();
- /// 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.
- if(configuration_t::instance().get_diagnostic_manager().initialize())
- return 0;
+ /// 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.
+ if(configuration_t::instance().get_diagnostic_manager().initialize())
+ return 0;
+ }
ERROR(binder_interface, "There was something wrong with CAN device Initialization. Check your config file maybe");
return 1;