GCS_MAVLlink: added handle_common_message()

this will make it easier to add common functions for mavlink messages
without having to do a commit for each vehicle
This commit is contained in:
Andrew Tridgell 2016-11-07 11:03:11 +11:00
parent e5a4dd4e56
commit da7ed73051
2 changed files with 17 additions and 1 deletions

View File

@ -272,11 +272,12 @@ protected:
void handle_gps_inject(const mavlink_message_t *msg, AP_GPS &gps);
void handle_common_message(mavlink_message_t *msg);
void handle_log_message(mavlink_message_t *msg, DataFlash_Class &dataflash);
void handle_setup_signing(const mavlink_message_t *msg);
uint8_t handle_preflight_reboot(const mavlink_command_long_t &packet, bool disable_overrides);
uint8_t handle_rc_bind(const mavlink_command_long_t &packet);
private:
float adjust_rate_for_stream_trigger(enum streams stream_num);

View File

@ -1803,3 +1803,18 @@ uint8_t GCS_MAVLINK::handle_rc_bind(const mavlink_command_long_t &packet)
}
return MAV_RESULT_ACCEPTED;
}
/*
handle messages which don't require vehicle specific data
*/
void GCS_MAVLINK::handle_common_message(mavlink_message_t *msg)
{
switch (msg->msgid) {
case MAVLINK_MSG_ID_SETUP_SIGNING:
handle_setup_signing(msg);
break;
case MAVLINK_MSG_ID_PARAM_REQUEST_READ:
handle_param_request_read(msg);
break;
}
}