Skip to content

Commit

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

if (!copter.ap.land_complete) {
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
Expand Down

0 comments on commit 36a0b8a

Please sign in to comment.