Skip to content

Commit

Permalink
AP_Scripting: do not send fragmented messages
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed May 30, 2024
1 parent 513938b commit a0f711a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/AP_Scripting/AP_Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ bool AP_Scripting::arming_checks(size_t buflen, char *buffer) const
lua_scripts::get_last_error_semaphore()->take_blocking();
const char *error_buf = lua_scripts::get_last_error_message();
if (error_buf != nullptr) {
buflen = buflen < 44 ? buflen : 43;
hal.util->snprintf(buffer, buflen, "Scripting: %s", error_buf);
lua_scripts::get_last_error_semaphore()->give();
return false;
Expand Down
3 changes: 3 additions & 0 deletions libraries/AP_Scripting/lua_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ void lua_scripts::print_error(MAV_SEVERITY severity) {
return;
}
last_print_ms = AP_HAL::millis();
if (strlen(error_msg_buf) > 44) {
error_msg_buf[45] = 0;
}
GCS_SEND_TEXT(severity, "Lua: %s", error_msg_buf);
error_msg_buf_sem.give();
}
Expand Down

0 comments on commit a0f711a

Please sign in to comment.