X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=CAN-binder%2Flow-can-binding%2Fbinding%2Flow-can-hat.cpp;h=ddaa5a2468945f332d4addba873f7aa0f6aab274;hb=ac43d4647b83a1793269699800da02c02aa5fed0;hp=b115a9646f32bc50a602559292fe8cd0c04571d9;hpb=692376f019562e48ddef074b427f2397cae25087;p=apps%2Flow-level-can-service.git diff --git a/CAN-binder/low-can-binding/binding/low-can-hat.cpp b/CAN-binder/low-can-binding/binding/low-can-hat.cpp index b115a96..ddaa5a2 100644 --- a/CAN-binder/low-can-binding/binding/low-can-hat.cpp +++ b/CAN-binder/low-can-binding/binding/low-can-hat.cpp @@ -17,6 +17,7 @@ */ #include "low-can-hat.hpp" +#include "low-can-subscription.hpp" #include #include @@ -24,7 +25,7 @@ #include #include -#include "configuration.hpp" +#include "application.hpp" #include "../can/can-bus.hpp" extern "C" @@ -66,21 +67,18 @@ extern "C" /// @return Exit code, zero if success. int afbBindingV1ServiceInit(struct afb_service service) { - can_bus_t& can_bus_manager = configuration_t::instance().get_can_bus_manager(); + can_bus_t& can_bus_manager = application_t::instance().get_can_bus_manager(); - /// Initialize CAN socket - if(can_bus_manager.init_can_dev() == 0) - { - can_bus_manager.start_threads(); + can_bus_manager.set_can_devices(); + 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(application_t::instance().get_diagnostic_manager().initialize()) + return 0; - ERROR(binder_interface, "%s: There was something wrong with CAN device Initialization. Check your config file maybe", __FUNCTION__); + ERROR(binder_interface, "%s: There was something wrong with CAN device Initialization.", __FUNCTION__); return 1; } };