Browse Source

GCS_MAVLink: add support for MAV_CMD_DEBUG_TRAP

c415-sdk
Peter Barker 6 years ago committed by Peter Barker
parent
commit
1650979a2b
  1. 1
      libraries/GCS_MAVLink/GCS.h
  2. 16
      libraries/GCS_MAVLink/GCS_Common.cpp

1
libraries/GCS_MAVLink/GCS.h

@ -440,6 +440,7 @@ protected: @@ -440,6 +440,7 @@ protected:
MAV_RESULT handle_command_do_set_mode(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_get_home_position(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_do_fence_enable(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_debug_trap(const mavlink_command_long_t &packet);
void handle_optical_flow(const mavlink_message_t &msg);

16
libraries/GCS_MAVLink/GCS_Common.cpp

@ -3608,6 +3608,18 @@ MAV_RESULT GCS_MAVLINK::handle_command_get_home_position(const mavlink_command_l @@ -3608,6 +3608,18 @@ MAV_RESULT GCS_MAVLINK::handle_command_get_home_position(const mavlink_command_l
return MAV_RESULT_ACCEPTED;
}
MAV_RESULT GCS_MAVLINK::handle_command_debug_trap(const mavlink_command_long_t &packet)
{
// magic number must be supplied to trap; you must *really* mean it.
if (uint32_t(packet.param1) != 32451) {
return MAV_RESULT_DENIED;
}
if (hal.util->trap()) {
return MAV_RESULT_ACCEPTED;
}
return MAV_RESULT_UNSUPPORTED;
}
MAV_RESULT GCS_MAVLINK::handle_command_do_gripper(const mavlink_command_long_t &packet)
{
AP_Gripper *gripper = AP::gripper();
@ -3775,6 +3787,10 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t @@ -3775,6 +3787,10 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
result = handle_command_get_home_position(packet);
break;
case MAV_CMD_DEBUG_TRAP:
result = handle_command_debug_trap(packet);
break;
case MAV_CMD_PREFLIGHT_STORAGE:
if (is_equal(packet.param1, 2.0f)) {
AP_Param::erase_all();

Loading…
Cancel
Save