X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=low-can-binding%2Fdiagnostic%2Fdiagnostic-manager.cpp;fp=low-can-binding%2Fdiagnostic%2Fdiagnostic-manager.cpp;h=f3c513c51bb47779ff8ad2d3da965a6a3d74f9a5;hb=db13354c18e888d04b776e584addb668d8614da4;hp=91dba470c153afe16fafcd7fdd33a94d0a277a94;hpb=e1caf27db81e9897af7512a0b47e0783593833d5;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/diagnostic/diagnostic-manager.cpp b/low-can-binding/diagnostic/diagnostic-manager.cpp index 91dba470..f3c513c5 100644 --- a/low-can-binding/diagnostic/diagnostic-manager.cpp +++ b/low-can-binding/diagnostic/diagnostic-manager.cpp @@ -56,16 +56,19 @@ diagnostic_manager_t::~diagnostic_manager_t() /// /// this will initialize DiagnosticShims and cancel all active requests /// if there are any. -bool diagnostic_manager_t::initialize() +bool diagnostic_manager_t::initialize(std::string diagnostic_bus) { - // Mandatory to set the bus before intialize shims. - bus_ = application_t::instance().get_diagnostic_bus(); - - init_diagnostic_shims(); - reset(); + if (! diagnostic_bus.empty()) + { + bus_ = diagnostic_bus; + init_diagnostic_shims(); + reset(); - initialized_ = true; - AFB_DEBUG("Diagnostic Manager initialized"); + AFB_DEBUG("Diagnostic Manager initialized"); + initialized_ = true; + return initialized_; + } + AFB_ERROR("Diagnostic Manager missing its bus name in the config"); return initialized_; }