Skip to content

Commit

Permalink
Plane: use ExpandingString to construct fence names
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Jan 27, 2024
1 parent 36a0b8a commit 00b8d16
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ArduPlane/fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ void Plane::fence_check()

if (new_breaches) {
char msg[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1];
uint8_t msglen = AC_Fence::get_fence_names(new_breaches, msg, MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN);
msg[msglen] = 0;

GCS_SEND_TEXT(MAV_SEVERITY_NOTICE, "%s breached", msg);
ExpandingString e(msg, MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1);
AC_Fence::get_fence_names(new_breaches, e);
GCS_SEND_TEXT(MAV_SEVERITY_NOTICE, "%s breached", e.get_writeable_string());

// if the user wants some kind of response and motors are armed
const uint8_t fence_act = fence.get_action();
Expand Down

0 comments on commit 00b8d16

Please sign in to comment.