mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
GCS_MAVLink: assert max length of statustexts we send to the GCS
This commit is contained in:
parent
db9f7c3dd5
commit
0bbe049477
@ -1741,6 +1741,12 @@ void GCS_MAVLINK::send_ahrs()
|
||||
*/
|
||||
void GCS::send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, const char *text)
|
||||
{
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||
if (strlen(text) > MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN) {
|
||||
AP_HAL::panic("Statustext (%s) too long", text);
|
||||
}
|
||||
#endif
|
||||
|
||||
AP_Logger *logger = AP_Logger::get_singleton();
|
||||
if (logger != nullptr) {
|
||||
logger->Write_Message(text);
|
||||
|
Loading…
Reference in New Issue
Block a user