mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
GCS_MAVLink: implement handling of MAV_CMD_DO_SET_MODE
This commit is contained in:
parent
8507763a1c
commit
6bd7089718
@ -299,6 +299,7 @@ protected:
|
||||
MAV_RESULT handle_command_long_message(mavlink_command_long_t &packet);
|
||||
MAV_RESULT handle_command_camera(const mavlink_command_long_t &packet);
|
||||
MAV_RESULT handle_command_do_send_banner(const mavlink_command_long_t &packet);
|
||||
MAV_RESULT handle_command_do_set_mode(const mavlink_command_long_t &packet);
|
||||
|
||||
// vehicle-overridable message send function
|
||||
virtual bool try_send_message(enum ap_message id);
|
||||
|
@ -2036,12 +2036,24 @@ MAV_RESULT GCS_MAVLINK::handle_command_do_send_banner(const mavlink_command_long
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
|
||||
MAV_RESULT GCS_MAVLINK::handle_command_do_set_mode(const mavlink_command_long_t &packet)
|
||||
{
|
||||
const MAV_MODE base_mode = (MAV_MODE)packet.param1;
|
||||
const uint32_t custom_mode = (uint32_t)packet.param2;
|
||||
|
||||
return _set_mode_common(base_mode, custom_mode);
|
||||
}
|
||||
|
||||
MAV_RESULT GCS_MAVLINK::handle_command_long_message(mavlink_command_long_t &packet)
|
||||
{
|
||||
MAV_RESULT result = MAV_RESULT_FAILED;
|
||||
|
||||
switch (packet.command) {
|
||||
|
||||
case MAV_CMD_DO_SET_MODE:
|
||||
result = handle_command_do_set_mode(packet);
|
||||
break;
|
||||
|
||||
case MAV_CMD_DO_SEND_BANNER:
|
||||
result = handle_command_do_send_banner(packet);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user