GCS_MAVLink: handle MAV_CMD_DO_SPRAYER as both long and int

This commit is contained in:
Peter Barker 2023-11-03 22:33:00 +11:00 committed by Andrew Tridgell
parent 9445cb2672
commit 1d08900cb0
2 changed files with 7 additions and 7 deletions

View File

@ -658,7 +658,7 @@ protected:
MAV_RESULT handle_command_do_set_roi(const mavlink_command_int_t &packet);
virtual MAV_RESULT handle_command_do_set_roi(const Location &roi_loc);
MAV_RESULT handle_command_do_gripper(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_do_sprayer(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_do_sprayer(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_do_set_mode(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_get_home_position(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_do_fence_enable(const mavlink_command_int_t &packet);

View File

@ -4584,7 +4584,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_do_gripper(const mavlink_command_long_t &
#endif // AP_GRIPPER_ENABLED
#if HAL_SPRAYER_ENABLED
MAV_RESULT GCS_MAVLINK::handle_command_do_sprayer(const mavlink_command_long_t &packet)
MAV_RESULT GCS_MAVLINK::handle_command_do_sprayer(const mavlink_command_int_t &packet)
{
AC_Sprayer *sprayer = AP::sprayer();
if (sprayer == nullptr) {
@ -4731,11 +4731,6 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
result = handle_command_do_gripper(packet);
break;
#endif
#if HAL_SPRAYER_ENABLED
case MAV_CMD_DO_SPRAYER:
result = handle_command_do_sprayer(packet);
break;
#endif
#if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED
case MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES: {
@ -5056,6 +5051,11 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &p
case MAV_CMD_DO_SET_MODE:
return handle_command_do_set_mode(packet);
#if HAL_SPRAYER_ENABLED
case MAV_CMD_DO_SPRAYER:
return handle_command_do_sprayer(packet);
#endif
#if AP_CAMERA_ENABLED
case MAV_CMD_DO_DIGICAM_CONFIGURE:
case MAV_CMD_DO_DIGICAM_CONTROL: