mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 00:10:35 +08:00
Improved doc for PanicBroadcaster
This commit is contained in:
@@ -32,10 +32,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begin broadcasting at the standard interval.
|
* Begin broadcasting at the standard interval (see BROADCASTING_INTERVAL_MS).
|
||||||
* This method does not block and can't fail.
|
* This method does not block and can't fail.
|
||||||
|
* @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);
|
void panic(const char* short_reason_description);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop broadcasting immediately.
|
* Stop broadcasting immediately.
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ void PanicBroadcaster::handleTimerEvent(const TimerEvent&)
|
|||||||
publishOnce();
|
publishOnce();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanicBroadcaster::panic(const char* short_reason)
|
void PanicBroadcaster::panic(const char* short_reason_description)
|
||||||
{
|
{
|
||||||
msg_.reason_text.clear();
|
msg_.reason_text.clear();
|
||||||
const char* p = short_reason;
|
const char* p = short_reason_description;
|
||||||
while (p && *p)
|
while (p && *p)
|
||||||
{
|
{
|
||||||
if (msg_.reason_text.size() == msg_.reason_text.capacity())
|
if (msg_.reason_text.size() == msg_.reason_text.capacity())
|
||||||
|
|||||||
Reference in New Issue
Block a user