GCS_MAVLink: added send_queued_parameters()

This commit is contained in:
Andrew Tridgell 2017-04-29 14:36:59 +10:00
parent 58861eb51c
commit 5c4ca3bf0b
2 changed files with 20 additions and 0 deletions

View File

@ -179,6 +179,9 @@ public:
// send a PARAM_VALUE message to all active MAVLink connections.
static void send_parameter_value_all(const char *param_name, ap_var_type param_type, float param_value);
// send queued parameters if needed
void send_queued_parameters(void);
/*
send a MAVLink message to all components with this vehicle's system id

View File

@ -340,3 +340,20 @@ void GCS_MAVLINK::send_parameter_value_all(const char *param_name, ap_var_type p
dataflash->Log_Write_Parameter(param_name, param_value);
}
}
/*
send queued parameters if needed
*/
void GCS_MAVLINK::send_queued_parameters(void)
{
if (_queued_parameter == nullptr &&
param_replies.empty()) {
return;
}
if (streamRates[STREAM_PARAMS].get() <= 0) {
streamRates[STREAM_PARAMS].set(10);
}
if (stream_trigger(STREAM_PARAMS)) {
send_message(MSG_NEXT_PARAM);
}
}