AP_Gernerator: IE_2400: lengthen message buffer and print error num

This commit is contained in:
Iampete1 2023-09-26 02:14:02 +01:00 committed by Andrew Tridgell
parent 90f7ed3410
commit c861e15853
2 changed files with 2 additions and 2 deletions

View File

@ -395,7 +395,7 @@ bool AP_Generator_IE_2400::is_low_error(const uint32_t err_in) const
bool AP_Generator_IE_2400::check_for_err_code(char* msg_txt, uint8_t msg_len) const
{
if ((_version == ProtocolVersion::V2) && (strlen(_valid_V2.info_str) > 0)) {
hal.util->snprintf(msg_txt, msg_len, "Fuel cell err %s", _valid_V2.info_str);
hal.util->snprintf(msg_txt, msg_len, "Fuel cell err %u.%u: %s", (unsigned)_err_code, (unsigned)_sub_err_code, _valid_V2.info_str);
return true;
}

View File

@ -168,7 +168,7 @@ void AP_Generator_IE_FuelCell::check_status(const uint32_t now)
update_state_msg();
// Check error codes
char msg_txt[32];
char msg_txt[64];
if (check_for_err_code_if_changed(msg_txt, sizeof(msg_txt))) {
GCS_SEND_TEXT(MAV_SEVERITY_ALERT, "%s", msg_txt);
}