Change-Id: I840fc6cc7e9cfd171b03cac508fedb8ece4b976d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
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;
}
/// Initialize Diagnostic manager that will handle obd2 requests.
/// We pass by default the first CAN bus device to its Initialization.
if(! diagnotic_bus || application_t::instance().get_diagnostic_manager().initialize(diagnotic_bus))
- AFB_WARNING("Diagnostic Manager: not initialized");
+ AFB_WARNING("Diagnostic Manager: not initialized. No diagnostic messages will be processed.");
return 0;
}