AntennaTracker: pass mavlink_message_t to handle_command_*_packet

the "special case" blocks are getting longer and longer.  Merge the switch statements for the command type to be handled by passing around the message.
This commit is contained in:
Peter Barker 2023-08-17 17:53:02 +10:00 committed by Andrew Tridgell
parent b141cca3d5
commit 915be41cb5
2 changed files with 3 additions and 3 deletions

View File

@ -425,7 +425,7 @@ MAV_RESULT GCS_MAVLINK_Tracker::handle_command_component_arm_disarm(const mavlin
return MAV_RESULT_UNSUPPORTED;
}
MAV_RESULT GCS_MAVLINK_Tracker::handle_command_long_packet(const mavlink_command_long_t &packet)
MAV_RESULT GCS_MAVLINK_Tracker::handle_command_long_packet(const mavlink_command_long_t &packet, const mavlink_message_t &msg)
{
switch(packet.command) {
@ -444,7 +444,7 @@ MAV_RESULT GCS_MAVLINK_Tracker::handle_command_long_packet(const mavlink_command
return MAV_RESULT_ACCEPTED;
default:
return GCS_MAVLINK::handle_command_long_packet(packet);
return GCS_MAVLINK::handle_command_long_packet(packet, msg);
}
}

View File

@ -21,7 +21,7 @@ protected:
MAV_RESULT handle_command_component_arm_disarm(const mavlink_command_int_t &packet) override;
MAV_RESULT _handle_command_preflight_calibration_baro(const mavlink_message_t &msg) override;
MAV_RESULT handle_command_long_packet(const mavlink_command_long_t &packet) override;
MAV_RESULT handle_command_long_packet(const mavlink_command_long_t &packet, const mavlink_message_t &msg) override;
int32_t global_position_int_relative_alt() const override {
return 0; // what if we have been picked up and carried somewhere?