From 8af9573806ba2348118240bbd068f2cb7e65f59a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 20 Mar 2014 09:55:04 +1100 Subject: [PATCH] GCS_MAVLink: allow logging of RADIO_STATUS, very useful for link analysis --- libraries/GCS_MAVLink/GCS.h | 2 +- libraries/GCS_MAVLink/GCS_Common.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 8e08a1c4ce..306cd8c790 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -311,7 +311,7 @@ private: void handle_param_request_list(mavlink_message_t *msg); void handle_param_request_read(mavlink_message_t *msg); void handle_param_set(mavlink_message_t *msg, DataFlash_Class *DataFlash); - void handle_radio_status(mavlink_message_t *msg); + void handle_radio_status(mavlink_message_t *msg, DataFlash_Class &dataflash, bool log_radio); // return true if this channel has hardware flow control bool have_flow_control(void); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index cf9b77c7ca..2cae6fc3ee 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -619,7 +619,7 @@ GCS_MAVLINK::send_text_P(gcs_severity severity, const prog_char_t *str) } -void GCS_MAVLINK::handle_radio_status(mavlink_message_t *msg) +void GCS_MAVLINK::handle_radio_status(mavlink_message_t *msg, DataFlash_Class &dataflash, bool log_radio) { mavlink_radio_t packet; mavlink_msg_radio_decode(msg, &packet); @@ -646,6 +646,11 @@ void GCS_MAVLINK::handle_radio_status(mavlink_message_t *msg) // the buffer has enough space, speed up a bit stream_slowdown--; } + + //log rssi, noise, etc if logging Performance monitoring data + if (log_radio) { + dataflash.Log_Write_Radio(packet); + } }