X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fbinding%2Fapplication.cpp;h=4c9641c47217d6d428a6eb381ef806c20d5c6cd0;hb=744d95cffe1241c97d922b18f6e3723fff7d64fe;hp=0b8963cbbbdf13646232edb6cacab32e58bd1a96;hpb=fad26418db56cf029d0b32f1fcc1309c545dac96;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/binding/application.cpp b/low-can-binding/binding/application.cpp index 0b8963cb..4c9641c4 100644 --- a/low-can-binding/binding/application.cpp +++ b/low-can-binding/binding/application.cpp @@ -71,10 +71,13 @@ int application_t::add_message_set(std::shared_ptr new_message_se return -1; } - for(auto new_diag_msg : new_message_set->get_diagnostic_messages()) + if(diagnostic_manager_.is_initialized()) { - if(old_msg_set->add_diagnostic_message(new_diag_msg) < 0) - return -1; + for(auto new_diag_msg : new_message_set->get_diagnostic_messages()) + { + if(old_msg_set->add_diagnostic_message(new_diag_msg) < 0) + return -1; + } } return 0; } @@ -151,13 +154,9 @@ bool application_t::is_engine_on() if(sf.signals.front()->get_last_value_with_timestamp().first > 0 && std::difftime(std::time(nullptr), last_timestamp_in_s) < ENGINE_VALUE_TIMEOUT) - { engine_on = true; - } else - { AFB_NOTICE("is_engine_on: engine.speed CAN signal found, but engine seems off"); - } } else {