From 3b715ade6b197a61832ac4c8408280c581a16930 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 23 Jan 2024 15:23:15 +1100 Subject: [PATCH] GCS_MAVLink: make rally/fence item conversion methods public --- libraries/GCS_MAVLink/MissionItemProtocol_Fence.cpp | 2 +- libraries/GCS_MAVLink/MissionItemProtocol_Fence.h | 6 +++++- libraries/GCS_MAVLink/MissionItemProtocol_Rally.h | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libraries/GCS_MAVLink/MissionItemProtocol_Fence.cpp b/libraries/GCS_MAVLink/MissionItemProtocol_Fence.cpp index bea8f3dd89..3d8cd593d0 100644 --- a/libraries/GCS_MAVLink/MissionItemProtocol_Fence.cpp +++ b/libraries/GCS_MAVLink/MissionItemProtocol_Fence.cpp @@ -95,7 +95,7 @@ uint16_t MissionItemProtocol_Fence::item_count() const return _fence.polyfence().num_stored_items(); } -static MAV_MISSION_RESULT convert_MISSION_ITEM_INT_to_AC_PolyFenceItem(const mavlink_mission_item_int_t &mission_item_int, AC_PolyFenceItem &ret) +MAV_MISSION_RESULT MissionItemProtocol_Fence::convert_MISSION_ITEM_INT_to_AC_PolyFenceItem(const mavlink_mission_item_int_t &mission_item_int, AC_PolyFenceItem &ret) { if (mission_item_int.frame != MAV_FRAME_GLOBAL && mission_item_int.frame != MAV_FRAME_GLOBAL_INT && diff --git a/libraries/GCS_MAVLink/MissionItemProtocol_Fence.h b/libraries/GCS_MAVLink/MissionItemProtocol_Fence.h index 56cadc02eb..58a984f60a 100644 --- a/libraries/GCS_MAVLink/MissionItemProtocol_Fence.h +++ b/libraries/GCS_MAVLink/MissionItemProtocol_Fence.h @@ -2,6 +2,8 @@ #include "MissionItemProtocol.h" +#include + class AC_PolyFence_loader; class MissionItemProtocol_Fence : public MissionItemProtocol { @@ -21,7 +23,9 @@ public: static function to format mission item as mavlink_mission_item_int_t */ static bool get_item_as_mission_item(uint16_t seq, mavlink_mission_item_int_t &ret_packet); - + + static MAV_MISSION_RESULT convert_MISSION_ITEM_INT_to_AC_PolyFenceItem(const mavlink_mission_item_int_t &mission_item_int, class AC_PolyFenceItem &ret); + protected: ap_message next_item_ap_message_id() const override { diff --git a/libraries/GCS_MAVLink/MissionItemProtocol_Rally.h b/libraries/GCS_MAVLink/MissionItemProtocol_Rally.h index f527f109bc..add6efa6ca 100644 --- a/libraries/GCS_MAVLink/MissionItemProtocol_Rally.h +++ b/libraries/GCS_MAVLink/MissionItemProtocol_Rally.h @@ -20,7 +20,9 @@ public: static function to get rally item as mavlink_mission_item_int_t */ static bool get_item_as_mission_item(uint16_t seq, mavlink_mission_item_int_t &ret_packet); - + + static MAV_MISSION_RESULT convert_MISSION_ITEM_INT_to_RallyLocation(const mavlink_mission_item_int_t &cmd, class RallyLocation &ret) WARN_IF_UNUSED; + protected: ap_message next_item_ap_message_id() const override { @@ -42,8 +44,6 @@ private: const mavlink_mission_request_int_t &packet, mavlink_mission_item_int_t &ret_packet) override WARN_IF_UNUSED; - static MAV_MISSION_RESULT convert_MISSION_ITEM_INT_to_RallyLocation(const mavlink_mission_item_int_t &cmd, class RallyLocation &ret) WARN_IF_UNUSED; - }; #endif // HAL_RALLY_ENABLED