///
/// 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();
+ if (! diagnostic_bus.empty())
+ {
+ bus_ = diagnostic_bus;
+ init_diagnostic_shims();
+ reset();
- init_diagnostic_shims();
- reset();
+ AFB_DEBUG("Diagnostic Manager initialized");
+ initialized_ = true;
+ return initialized_;
+ }
+ AFB_ERROR("Diagnostic Manager missing its bus name in the config");
+ return initialized_;
+}
- initialized_ = true;
- AFB_DEBUG("Diagnostic Manager initialized");
+bool diagnostic_manager_t::is_initialized() const
+{
return initialized_;
}
bcm_msg.msg_head.can_id = arbitration_id;
bcm_msg.msg_head.flags = SETTIMER|STARTTIMER|TX_CP_CAN_ID;
bcm_msg.msg_head.count = 0;
+ bcm_msg.msg_head.ival1.tv_sec = 0;
+ bcm_msg.msg_head.ival1.tv_usec = 0;
bcm_msg.msg_head.ival2.tv_sec = freq.tv_sec;
bcm_msg.msg_head.ival2.tv_usec = freq.tv_usec;
bcm_msg.msg_head.nframes = 1;