From f94e36a8064b2826a8f1769b02c8351f405a55d2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 17 Oct 2019 18:08:17 +1100 Subject: [PATCH] AP_BattMonitor: use corrected version of send_to_components --- libraries/AP_BattMonitor/AP_BattMonitor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor.cpp b/libraries/AP_BattMonitor/AP_BattMonitor.cpp index 2ce27e2c5a..284c56b72f 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor.cpp @@ -465,12 +465,10 @@ void AP_BattMonitor::checkPoweringOff(void) AP_Notify::flags.powering_off = true; // Send a Mavlink broadcast announcing the shutdown - mavlink_message_t msg; mavlink_command_long_t cmd_msg{}; cmd_msg.command = MAV_CMD_POWER_OFF_INITIATED; cmd_msg.param1 = i+1; - mavlink_msg_command_long_encode(mavlink_system.sysid, MAV_COMP_ID_ALL, &msg, &cmd_msg); - GCS_MAVLINK::send_to_components(msg); + GCS_MAVLINK::send_to_components(MAVLINK_MSG_ID_COMMAND_LONG, (char*)&cmd_msg, sizeof(cmd_msg)); gcs().send_text(MAV_SEVERITY_WARNING, "Vehicle %d battery %d is powering off", mavlink_system.sysid, i+1); // only send this once