mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 13:13:33 +08:00
Configurable priority in high-level protocol logic classes
This commit is contained in:
@@ -48,7 +48,8 @@ public:
|
||||
* @param short_reason Short ASCII string that describes the reason of the panic, 7 characters max.
|
||||
* If the string exceeds 7 characters, it will be truncated.
|
||||
*/
|
||||
void panic(const char* short_reason_description)
|
||||
void panic(const char* short_reason_description,
|
||||
const TransferPriority priority = TransferPriority::Default)
|
||||
{
|
||||
msg_.reason_text.clear();
|
||||
const char* p = short_reason_description;
|
||||
@@ -64,6 +65,8 @@ public:
|
||||
|
||||
UAVCAN_TRACE("PanicBroadcaster", "Panicking with reason '%s'", getReason().c_str());
|
||||
|
||||
pub_.setPriority(priority);
|
||||
|
||||
publishOnce();
|
||||
startPeriodic(MonotonicDuration::fromMSec(protocol::Panic::BROADCASTING_PERIOD_MS));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user