X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=low-can-binding%2Fbinding%2Fapplication.cpp;h=c5dfa1b6cfe80ef4cd3ef04a18171cf2210ae7d6;hb=cc48ab799cf5357f4d573d80c07f6843e50bc8e8;hp=bb3bf15b75ce3950c116fedf9e18f7ed1a3586f1;hpb=04b7efcdd1a8dfdf461c78d083aabee5445e54bd;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 bb3bf15b..c5dfa1b6 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; } @@ -171,13 +174,9 @@ bool application_t::is_engine_on() if(sf.diagnostic_messages.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 diagnostic message found, but engine seems off"); - } } else {