summaryrefslogtreecommitdiffstats
path: root/src/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-13 15:03:00 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:15:55 +0100
commit542518e3f4390fcb0d8fb17bcbb14c7eb4335a61 (patch)
tree340eda25b52c5f6e4b47dae3aace322c57359e55 /src/low-can-binding.cpp
parentf0d7a6523955ee94a32ec4b62e2a207b23f62316 (diff)
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'src/low-can-binding.cpp')
-rw-r--r--src/low-can-binding.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/low-can-binding.cpp b/src/low-can-binding.cpp
index 0c418fe8..8ecf7424 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<obd2_signal_t*> 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;