///
/// 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_;
}
if(entry != nullptr)
{
if(diagnostic_request_equals(&entry->get_handle()->request, &request))
- {return entry;}
+ return entry;
}
}
return nullptr;
}
}
else
- { AFB_DEBUG("Can't add request, one already exists with same key");}
+ AFB_DEBUG("Can't add request, one already exists with same key");
return entry;
}
found_signals = utils::signals_manager_t::instance().find_signals(build_DynamicField((double) adr->get_pid()));
if(adr->get_decoder() != nullptr)
- {
value = adr->get_decoder()(&response, value);
- }
if((response.success && adr->get_name().size()) > 0)
{
}
if(adr->get_callback() != nullptr)
- {
adr->get_callback()(adr, &response, value);
- }
// Reset the completed flag handle to make sure that it will be reprocessed the next time.
adr->get_handle()->success = false;