5 #ifndef UAVCAN_PROTOCOL_PANIC_BROADCASTER_HPP_INCLUDED
6 #define UAVCAN_PROTOCOL_PANIC_BROADCASTER_HPP_INCLUDED
11 #include <uavcan/protocol/Panic.hpp>
50 void panic(
const char* short_reason_description,
54 msg_.reason_text.clear();
55 const char* p = short_reason_description;
58 if (msg_.reason_text.size() == msg_.reason_text.capacity())
62 msg_.reason_text.push_back(protocol::Panic::FieldTypes::reason_text::ValueType(*p));
66 UAVCAN_TRACE(
"PanicBroadcaster",
"Panicking with reason '%s'", getReason().c_str());
72 startPeriodic(broadcasting_period);
81 msg_.reason_text.clear();
86 const typename protocol::Panic::FieldTypes::reason_text&
getReason()
const
88 return msg_.reason_text;
94 #endif // UAVCAN_PROTOCOL_PANIC_BROADCASTER_HPP_INCLUDED