From 64c723fd314ccae3cbb394bbcff8f9907697dbf9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 May 2019 18:20:20 +1000 Subject: [PATCH] GCS_MAVLink: record mavlink msg IDs for watchdog --- libraries/GCS_MAVLink/GCS_Common.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 1b79ede062..d791d6d5d6 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -1507,6 +1507,7 @@ GCS_MAVLINK::update_receive(uint32_t max_time_us) // Try to get a new message if (mavlink_parse_char(chan, c, &msg, &status)) { + hal.util->persistent_data.last_mavlink_msgid = msg.msgid; hal.util->perf_begin(_perf_packet); packetReceived(status, msg); hal.util->perf_end(_perf_packet); @@ -3737,6 +3738,8 @@ void GCS_MAVLINK::handle_command_long(mavlink_message_t *msg) mavlink_command_long_t packet; mavlink_msg_command_long_decode(msg, &packet); + hal.util->persistent_data.last_mavlink_cmd = packet.command; + const MAV_RESULT result = handle_command_long_packet(packet); // send ACK or NAK @@ -3854,6 +3857,8 @@ void GCS_MAVLINK::handle_command_int(mavlink_message_t *msg) mavlink_command_int_t packet; mavlink_msg_command_int_decode(msg, &packet); + hal.util->persistent_data.last_mavlink_cmd = packet.command; + const MAV_RESULT result = handle_command_int_packet(packet); // send ACK or NAK