GCS_MAVLink: allow logging of RADIO_STATUS, very useful for link analysis

This commit is contained in:
Andrew Tridgell 2014-03-20 09:55:04 +11:00
parent 68dbfd6315
commit 8af9573806
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -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);
}
}