diff --git a/proto b/proto index 1b17faedb..638bf9c21 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 1b17faedb910bb0eefcbafcc0d43185886a18ed2 +Subproject commit 638bf9c21335e1ade2f80e90d45dee3c1365f0e8 diff --git a/src/mavsdk/core/mavlink_mission_transfer_server.cpp b/src/mavsdk/core/mavlink_mission_transfer_server.cpp index afe143a04..98671e2c4 100644 --- a/src/mavsdk/core/mavlink_mission_transfer_server.cpp +++ b/src/mavsdk/core/mavlink_mission_transfer_server.cpp @@ -31,14 +31,6 @@ MavlinkMissionTransferServer::receive_incoming_items_async( uint8_t target_component, ResultAndItemsCallback callback) { - if (!_int_messages_supported) { - if (callback) { - LogErr() << "Int messages are not supported."; - callback(Result::IntMessagesNotSupported, {}); - } - return {}; - } - auto ptr = std::make_shared( _sender, _message_handler, @@ -64,14 +56,6 @@ MavlinkMissionTransferServer::send_outgoing_items_async( uint8_t target_component, ResultCallback callback) { - if (!_int_messages_supported) { - if (callback) { - LogErr() << "Int messages are not supported."; - callback(Result::IntMessagesNotSupported); - } - return {}; - } - auto ptr = std::make_shared( _sender, _message_handler, @@ -377,33 +361,6 @@ void MavlinkMissionTransferServer::SendOutgoingMission::start() std::lock_guard lock(_mutex); _started = true; - - for (unsigned i = 0; i < _items.size(); ++i) { - if (_items[i].seq != i) { - LogWarn() << "Invalid sequence"; - callback_and_reset(Result::InvalidSequence); - return; - } - } - - if (_items.size() > 0) { - int num_currents = 0; - std::for_each(_items.cbegin(), _items.cend(), [&num_currents](const ItemInt& item) { - num_currents += item.current; - }); - if (num_currents != 1) { - callback_and_reset(Result::CurrentInvalid); - return; - } - - if (std::any_of(_items.cbegin(), _items.cend(), [this](const ItemInt& item) { - return item.mission_type != _type; - })) { - callback_and_reset(Result::MissionTypeNotConsistent); - return; - } - } - _retries_done = 0; _step = Step::SendCount; _cookie = _timeout_handler.add([this]() { process_timeout(); }, _timeout_s); diff --git a/src/mavsdk/core/mavlink_mission_transfer_server.h b/src/mavsdk/core/mavlink_mission_transfer_server.h index adb64ed49..6849ed057 100644 --- a/src/mavsdk/core/mavlink_mission_transfer_server.h +++ b/src/mavsdk/core/mavlink_mission_transfer_server.h @@ -216,8 +216,6 @@ class MavlinkMissionTransferServer { void do_work(); bool is_idle(); - void set_int_messages_supported(bool supported); - // Non-copyable MavlinkMissionTransferServer(const MavlinkMissionTransferServer&) = delete; const MavlinkMissionTransferServer& operator=(const MavlinkMissionTransferServer&) = delete; @@ -230,7 +228,6 @@ class MavlinkMissionTransferServer { LockedQueue _work_queue{}; - bool _int_messages_supported{true}; bool _debugging{false}; }; diff --git a/src/mavsdk/core/mavlink_mission_transfer_server_test.cpp b/src/mavsdk/core/mavlink_mission_transfer_server_test.cpp index 7b6a95ff4..e11e34486 100644 --- a/src/mavsdk/core/mavlink_mission_transfer_server_test.cpp +++ b/src/mavsdk/core/mavlink_mission_transfer_server_test.cpp @@ -524,153 +524,6 @@ TEST_F(MavlinkMissionTransferServerTest, SendOutgoingMissionEmptyMission) EXPECT_TRUE(mmt.is_idle()); } -TEST_F(MavlinkMissionTransferServerTest, SendOutgoingMissionDoesComplainAboutWrongSequence) -{ - std::vector items; - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 0)); - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 2)); - - std::promise prom; - auto fut = prom.get_future(); - - mmt.send_outgoing_items_async( - MAV_MISSION_TYPE_MISSION, - items, - target_address.system_id, - target_address.component_id, - [&prom](Result result) { - EXPECT_EQ(result, Result::InvalidSequence); - ONCE_ONLY; - prom.set_value(); - }); - mmt.do_work(); - - EXPECT_EQ(fut.wait_for(std::chrono::seconds(1)), std::future_status::ready); - - mmt.do_work(); - EXPECT_TRUE(mmt.is_idle()); -} - -TEST_F( - MavlinkMissionTransferServerTest, - SendOutgoingMissionDoesComplainAboutInconsistentMissionTypesInAPI) -{ - std::vector items; - items.push_back(make_item(MAV_MISSION_TYPE_FENCE, 0)); - items.push_back(make_item(MAV_MISSION_TYPE_FENCE, 1)); - items.push_back(make_item(MAV_MISSION_TYPE_FENCE, 2)); - - std::promise prom; - auto fut = prom.get_future(); - - mmt.send_outgoing_items_async( - MAV_MISSION_TYPE_MISSION, - items, - target_address.system_id, - target_address.component_id, - [&prom](Result result) { - EXPECT_EQ(result, Result::MissionTypeNotConsistent); - ONCE_ONLY; - prom.set_value(); - }); - mmt.do_work(); - - EXPECT_EQ(fut.wait_for(std::chrono::seconds(1)), std::future_status::ready); - - mmt.do_work(); - EXPECT_TRUE(mmt.is_idle()); -} - -TEST_F( - MavlinkMissionTransferServerTest, - SendOutgoingMissionDoesComplainAboutInconsistentMissionTypesInItems) -{ - std::vector items; - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 0)); - items.push_back(make_item(MAV_MISSION_TYPE_FENCE, 1)); - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 2)); - - std::promise prom; - auto fut = prom.get_future(); - - mmt.send_outgoing_items_async( - MAV_MISSION_TYPE_MISSION, - items, - target_address.system_id, - target_address.component_id, - [&prom](Result result) { - EXPECT_EQ(result, Result::MissionTypeNotConsistent); - ONCE_ONLY; - prom.set_value(); - }); - mmt.do_work(); - - EXPECT_EQ(fut.wait_for(std::chrono::seconds(1)), std::future_status::ready); - - mmt.do_work(); - EXPECT_TRUE(mmt.is_idle()); -} - -TEST_F(MavlinkMissionTransferServerTest, SendOutgoingMissionDoesComplainAboutNoCurrent) -{ - std::vector items; - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 0)); - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 1)); - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 2)); - // Remove the current flag again. - items[0].current = 0; - - std::promise prom; - auto fut = prom.get_future(); - - mmt.send_outgoing_items_async( - MAV_MISSION_TYPE_MISSION, - items, - target_address.system_id, - target_address.component_id, - [&prom](Result result) { - EXPECT_EQ(result, Result::CurrentInvalid); - ONCE_ONLY; - prom.set_value(); - }); - mmt.do_work(); - - EXPECT_EQ(fut.wait_for(std::chrono::seconds(1)), std::future_status::ready); - - mmt.do_work(); - EXPECT_TRUE(mmt.is_idle()); -} - -TEST_F(MavlinkMissionTransferServerTest, SendOutgoingMissionDoesComplainAboutTwoCurrents) -{ - std::vector items; - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 0)); - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 1)); - items.push_back(make_item(MAV_MISSION_TYPE_MISSION, 2)); - // Add another current. - items[1].current = 1; - - std::promise prom; - auto fut = prom.get_future(); - - mmt.send_outgoing_items_async( - MAV_MISSION_TYPE_MISSION, - items, - target_address.system_id, - target_address.component_id, - [&prom](Result result) { - EXPECT_EQ(result, Result::CurrentInvalid); - ONCE_ONLY; - prom.set_value(); - }); - mmt.do_work(); - - EXPECT_EQ(fut.wait_for(std::chrono::seconds(1)), std::future_status::ready); - - mmt.do_work(); - EXPECT_TRUE(mmt.is_idle()); -} - TEST_F(MavlinkMissionTransferServerTest, SendOutgoingMissionDoesNotCrashIfCallbackIsNull) { ON_CALL(mock_sender, queue_message(_)).WillByDefault(Return(false)); diff --git a/src/mavsdk/plugins/mission_raw_server/include/plugins/mission_raw_server/mission_raw_server.h b/src/mavsdk/plugins/mission_raw_server/include/plugins/mission_raw_server/mission_raw_server.h index 11b2ad7a3..25c20e69f 100644 --- a/src/mavsdk/plugins/mission_raw_server/include/plugins/mission_raw_server/mission_raw_server.h +++ b/src/mavsdk/plugins/mission_raw_server/include/plugins/mission_raw_server/mission_raw_server.h @@ -185,33 +185,6 @@ class MissionRawServer : public ServerPluginBase { */ void unsubscribe_incoming_mission(IncomingMissionHandle handle); - /** - * @brief Poll for 'MissionPlan' (blocking). - * - * @return One MissionPlan update. - */ - MissionPlan incoming_mission() const; - - /** - * @brief Callback type for subscribe_outgoing_mission. - */ - using OutgoingMissionCallback = std::function; - - /** - * @brief Handle type for subscribe_outgoing_mission. - */ - using OutgoingMissionHandle = Handle; - - /** - * @brief Subscribe to when a new mission download request completes (asynchronous) - */ - OutgoingMissionHandle subscribe_outgoing_mission(const OutgoingMissionCallback& callback); - - /** - * @brief Unsubscribe from subscribe_outgoing_mission - */ - void unsubscribe_outgoing_mission(OutgoingMissionHandle handle); - /** * @brief Callback type for subscribe_current_item_changed. */ @@ -233,13 +206,6 @@ class MissionRawServer : public ServerPluginBase { */ void unsubscribe_current_item_changed(CurrentItemChangedHandle handle); - /** - * @brief Poll for 'MissionItem' (blocking). - * - * @return One MissionItem update. - */ - MissionItem current_item_changed() const; - /** * @brief Set Current item as completed * @@ -269,13 +235,6 @@ class MissionRawServer : public ServerPluginBase { */ void unsubscribe_clear_all(ClearAllHandle handle); - /** - * @brief Poll for 'uint32_t' (blocking). - * - * @return One uint32_t update. - */ - uint32_t clear_all() const; - /** * @brief Copy constructor. */ diff --git a/src/mavsdk/plugins/mission_raw_server/mission_raw_server.cpp b/src/mavsdk/plugins/mission_raw_server/mission_raw_server.cpp index 1478d1643..5438ae787 100644 --- a/src/mavsdk/plugins/mission_raw_server/mission_raw_server.cpp +++ b/src/mavsdk/plugins/mission_raw_server/mission_raw_server.cpp @@ -32,22 +32,6 @@ void MissionRawServer::unsubscribe_incoming_mission(IncomingMissionHandle handle _impl->unsubscribe_incoming_mission(handle); } -MissionRawServer::MissionPlan MissionRawServer::incoming_mission() const -{ - return _impl->incoming_mission(); -} - -MissionRawServer::OutgoingMissionHandle -MissionRawServer::subscribe_outgoing_mission(const OutgoingMissionCallback& callback) -{ - return _impl->subscribe_outgoing_mission(callback); -} - -void MissionRawServer::unsubscribe_outgoing_mission(OutgoingMissionHandle handle) -{ - _impl->unsubscribe_outgoing_mission(handle); -} - MissionRawServer::CurrentItemChangedHandle MissionRawServer::subscribe_current_item_changed(const CurrentItemChangedCallback& callback) { @@ -59,11 +43,6 @@ void MissionRawServer::unsubscribe_current_item_changed(CurrentItemChangedHandle _impl->unsubscribe_current_item_changed(handle); } -MissionRawServer::MissionItem MissionRawServer::current_item_changed() const -{ - return _impl->current_item_changed(); -} - void MissionRawServer::set_current_item_complete() const { _impl->set_current_item_complete(); @@ -80,11 +59,6 @@ void MissionRawServer::unsubscribe_clear_all(ClearAllHandle handle) _impl->unsubscribe_clear_all(handle); } -uint32_t MissionRawServer::clear_all() const -{ - return _impl->clear_all(); -} - bool operator==(const MissionRawServer::MissionItem& lhs, const MissionRawServer::MissionItem& rhs) { return (rhs.seq == lhs.seq) && (rhs.frame == lhs.frame) && (rhs.command == lhs.command) && diff --git a/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.cpp b/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.cpp index 0d29a884c..cc6f33e27 100644 --- a/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.cpp +++ b/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.cpp @@ -320,24 +320,6 @@ void MissionRawServerImpl::unsubscribe_incoming_mission( _incoming_mission_callbacks.unsubscribe(handle); } -MissionRawServer::OutgoingMissionHandle MissionRawServerImpl::subscribe_outgoing_mission( - const MissionRawServer::OutgoingMissionCallback& callback) -{ - return _outgoing_mission_callbacks.subscribe(callback); -} - -void MissionRawServerImpl::unsubscribe_outgoing_mission( - MissionRawServer::OutgoingMissionHandle handle) -{ - _outgoing_mission_callbacks.unsubscribe(handle); -} - -MissionRawServer::MissionPlan MissionRawServerImpl::incoming_mission() const -{ - // TO-DO - return {}; -} - MissionRawServer::CurrentItemChangedHandle MissionRawServerImpl::subscribe_current_item_changed( const MissionRawServer::CurrentItemChangedCallback& callback) { @@ -361,18 +343,6 @@ void MissionRawServerImpl::unsubscribe_clear_all(MissionRawServer::ClearAllHandl _clear_all_callbacks.unsubscribe(handle); } -uint32_t MissionRawServerImpl::clear_all() const -{ - // TO-DO - return {}; -} - -MissionRawServer::MissionItem MissionRawServerImpl::current_item_changed() const -{ - // TO-DO - return {}; -} - void MissionRawServerImpl::set_current_item_complete() { if (_current_seq + 1 > _current_mission.size()) { diff --git a/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.h b/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.h index bc0926137..d3fcf9eb6 100644 --- a/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.h +++ b/src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.h @@ -22,10 +22,6 @@ class MissionRawServerImpl : public ServerPluginImplBase { subscribe_incoming_mission(const MissionRawServer::IncomingMissionCallback& callback); void unsubscribe_incoming_mission(MissionRawServer::IncomingMissionHandle handle); - MissionRawServer::OutgoingMissionHandle - subscribe_outgoing_mission(const MissionRawServer::OutgoingMissionCallback& callback); - void unsubscribe_outgoing_mission(MissionRawServer::OutgoingMissionHandle handle); - MissionRawServer::CurrentItemChangedHandle subscribe_current_item_changed(const MissionRawServer::CurrentItemChangedCallback& callback); void unsubscribe_current_item_changed(MissionRawServer::CurrentItemChangedHandle handle); @@ -36,10 +32,6 @@ class MissionRawServerImpl : public ServerPluginImplBase { void set_current_item_complete(); - MissionRawServer::MissionPlan incoming_mission() const; - MissionRawServer::MissionItem current_item_changed() const; - uint32_t clear_all() const; - private: void process_mission_count(const mavlink_message_t& message); void process_mission_request_list(const mavlink_message_t& message); diff --git a/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.cc b/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.cc index de0e66eeb..deb5212be 100644 --- a/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.cc +++ b/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.cc @@ -25,7 +25,6 @@ namespace mission_raw_server { static const char* MissionRawServerService_method_names[] = { "/mavsdk.rpc.mission_raw_server.MissionRawServerService/SubscribeIncomingMission", - "/mavsdk.rpc.mission_raw_server.MissionRawServerService/SubscribeOutgoingMission", "/mavsdk.rpc.mission_raw_server.MissionRawServerService/SubscribeCurrentItemChanged", "/mavsdk.rpc.mission_raw_server.MissionRawServerService/SetCurrentItemComplete", "/mavsdk.rpc.mission_raw_server.MissionRawServerService/SubscribeClearAll", @@ -39,10 +38,9 @@ std::unique_ptr< MissionRawServerService::Stub> MissionRawServerService::NewStub MissionRawServerService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) : channel_(channel), rpcmethod_SubscribeIncomingMission_(MissionRawServerService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - , rpcmethod_SubscribeOutgoingMission_(MissionRawServerService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - , rpcmethod_SubscribeCurrentItemChanged_(MissionRawServerService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - , rpcmethod_SetCurrentItemComplete_(MissionRawServerService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SubscribeClearAll_(MissionRawServerService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_SubscribeCurrentItemChanged_(MissionRawServerService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + , rpcmethod_SetCurrentItemComplete_(MissionRawServerService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SubscribeClearAll_(MissionRawServerService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) {} ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* MissionRawServerService::Stub::SubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request) { @@ -61,22 +59,6 @@ ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionRes return ::grpc::internal::ClientAsyncReaderFactory< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>::Create(channel_.get(), cq, rpcmethod_SubscribeIncomingMission_, context, request, false, nullptr); } -::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* MissionRawServerService::Stub::SubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request) { - return ::grpc::internal::ClientReaderFactory< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>::Create(channel_.get(), rpcmethod_SubscribeOutgoingMission_, context, request); -} - -void MissionRawServerService::Stub::async::SubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* reactor) { - ::grpc::internal::ClientCallbackReaderFactory< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_SubscribeOutgoingMission_, context, request, reactor); -} - -::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* MissionRawServerService::Stub::AsyncSubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) { - return ::grpc::internal::ClientAsyncReaderFactory< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>::Create(channel_.get(), cq, rpcmethod_SubscribeOutgoingMission_, context, request, true, tag); -} - -::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* MissionRawServerService::Stub::PrepareAsyncSubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncReaderFactory< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>::Create(channel_.get(), cq, rpcmethod_SubscribeOutgoingMission_, context, request, false, nullptr); -} - ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* MissionRawServerService::Stub::SubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request) { return ::grpc::internal::ClientReaderFactory< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>::Create(channel_.get(), rpcmethod_SubscribeCurrentItemChanged_, context, request); } @@ -146,16 +128,6 @@ MissionRawServerService::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( MissionRawServerService_method_names[1], ::grpc::internal::RpcMethod::SERVER_STREAMING, - new ::grpc::internal::ServerStreamingHandler< MissionRawServerService::Service, ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest, ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>( - [](MissionRawServerService::Service* service, - ::grpc::ServerContext* ctx, - const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* req, - ::grpc::ServerWriter<::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* writer) { - return service->SubscribeOutgoingMission(ctx, req, writer); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MissionRawServerService_method_names[2], - ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< MissionRawServerService::Service, ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest, ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>( [](MissionRawServerService::Service* service, ::grpc::ServerContext* ctx, @@ -164,7 +136,7 @@ MissionRawServerService::Service::Service() { return service->SubscribeCurrentItemChanged(ctx, req, writer); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - MissionRawServerService_method_names[3], + MissionRawServerService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< MissionRawServerService::Service, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](MissionRawServerService::Service* service, @@ -174,7 +146,7 @@ MissionRawServerService::Service::Service() { return service->SetCurrentItemComplete(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - MissionRawServerService_method_names[4], + MissionRawServerService_method_names[3], ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< MissionRawServerService::Service, ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest, ::mavsdk::rpc::mission_raw_server::ClearAllResponse>( [](MissionRawServerService::Service* service, @@ -195,13 +167,6 @@ ::grpc::Status MissionRawServerService::Service::SubscribeIncomingMission(::grpc return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } -::grpc::Status MissionRawServerService::Service::SubscribeOutgoingMission(::grpc::ServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* writer) { - (void) context; - (void) request; - (void) writer; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - ::grpc::Status MissionRawServerService::Service::SubscribeCurrentItemChanged(::grpc::ServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* request, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* writer) { (void) context; (void) request; diff --git a/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.h b/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.h index 30de0e203..d8ed59edb 100644 --- a/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.h +++ b/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.grpc.pb.h @@ -51,17 +51,6 @@ class MissionRawServerService final { return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>>(PrepareAsyncSubscribeIncomingMissionRaw(context, request, cq)); } // - // Subscribe to when a new mission download request completes (asynchronous) - std::unique_ptr< ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>> SubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request) { - return std::unique_ptr< ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>>(SubscribeOutgoingMissionRaw(context, request)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>> AsyncSubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>>(AsyncSubscribeOutgoingMissionRaw(context, request, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>> PrepareAsyncSubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>>(PrepareAsyncSubscribeOutgoingMissionRaw(context, request, cq)); - } - // // Subscribe to when a new current item is set std::unique_ptr< ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>> SubscribeCurrentItemChanged(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request) { return std::unique_ptr< ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>>(SubscribeCurrentItemChangedRaw(context, request)); @@ -99,9 +88,6 @@ class MissionRawServerService final { // Subscribe to when a new mission is uploaded (asynchronous). virtual void SubscribeIncomingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* reactor) = 0; // - // Subscribe to when a new mission download request completes (asynchronous) - virtual void SubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* reactor) = 0; - // // Subscribe to when a new current item is set virtual void SubscribeCurrentItemChanged(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* reactor) = 0; // @@ -119,9 +105,6 @@ class MissionRawServerService final { virtual ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* SubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* AsyncSubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* PrepareAsyncSubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* SubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request) = 0; - virtual ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* AsyncSubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* PrepareAsyncSubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientReaderInterface< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* SubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* AsyncSubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderInterface< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* PrepareAsyncSubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -143,15 +126,6 @@ class MissionRawServerService final { std::unique_ptr< ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>> PrepareAsyncSubscribeIncomingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>>(PrepareAsyncSubscribeIncomingMissionRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>> SubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request) { - return std::unique_ptr< ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>>(SubscribeOutgoingMissionRaw(context, request)); - } - std::unique_ptr< ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>> AsyncSubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>>(AsyncSubscribeOutgoingMissionRaw(context, request, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>> PrepareAsyncSubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>>(PrepareAsyncSubscribeOutgoingMissionRaw(context, request, cq)); - } std::unique_ptr< ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>> SubscribeCurrentItemChanged(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request) { return std::unique_ptr< ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>>(SubscribeCurrentItemChangedRaw(context, request)); } @@ -181,7 +155,6 @@ class MissionRawServerService final { public StubInterface::async_interface { public: void SubscribeIncomingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* reactor) override; - void SubscribeOutgoingMission(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* reactor) override; void SubscribeCurrentItemChanged(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* request, ::grpc::ClientReadReactor< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* reactor) override; void SetCurrentItemComplete(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest* request, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse* response, std::function) override; void SetCurrentItemComplete(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest* request, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse* response, ::grpc::ClientUnaryReactor* reactor) override; @@ -200,9 +173,6 @@ class MissionRawServerService final { ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* SubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* AsyncSubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* PrepareAsyncSubscribeIncomingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* SubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request) override; - ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* AsyncSubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* PrepareAsyncSubscribeOutgoingMissionRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientReader< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* SubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* AsyncSubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* PrepareAsyncSubscribeCurrentItemChangedRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest& request, ::grpc::CompletionQueue* cq) override; @@ -212,7 +182,6 @@ class MissionRawServerService final { ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::ClearAllResponse>* AsyncSubscribeClearAllRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::mission_raw_server::ClearAllResponse>* PrepareAsyncSubscribeClearAllRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest& request, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_SubscribeIncomingMission_; - const ::grpc::internal::RpcMethod rpcmethod_SubscribeOutgoingMission_; const ::grpc::internal::RpcMethod rpcmethod_SubscribeCurrentItemChanged_; const ::grpc::internal::RpcMethod rpcmethod_SetCurrentItemComplete_; const ::grpc::internal::RpcMethod rpcmethod_SubscribeClearAll_; @@ -227,9 +196,6 @@ class MissionRawServerService final { // Subscribe to when a new mission is uploaded (asynchronous). virtual ::grpc::Status SubscribeIncomingMission(::grpc::ServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest* request, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* writer); // - // Subscribe to when a new mission download request completes (asynchronous) - virtual ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* writer); - // // Subscribe to when a new current item is set virtual ::grpc::Status SubscribeCurrentItemChanged(::grpc::ServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* request, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* writer); // @@ -260,32 +226,12 @@ class MissionRawServerService final { } }; template - class WithAsyncMethod_SubscribeOutgoingMission : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_SubscribeOutgoingMission() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_SubscribeOutgoingMission() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* /*writer*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSubscribeOutgoingMission(::grpc::ServerContext* context, ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request, ::grpc::ServerAsyncWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); - } - }; - template class WithAsyncMethod_SubscribeCurrentItemChanged : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SubscribeCurrentItemChanged() { - ::grpc::Service::MarkMethodAsync(2); + ::grpc::Service::MarkMethodAsync(1); } ~WithAsyncMethod_SubscribeCurrentItemChanged() override { BaseClassMustBeDerivedFromService(this); @@ -296,7 +242,7 @@ class MissionRawServerService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSubscribeCurrentItemChanged(::grpc::ServerContext* context, ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* request, ::grpc::ServerAsyncWriter< ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(2, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -305,7 +251,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SetCurrentItemComplete() { - ::grpc::Service::MarkMethodAsync(3); + ::grpc::Service::MarkMethodAsync(2); } ~WithAsyncMethod_SetCurrentItemComplete() override { BaseClassMustBeDerivedFromService(this); @@ -316,7 +262,7 @@ class MissionRawServerService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetCurrentItemComplete(::grpc::ServerContext* context, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -325,7 +271,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SubscribeClearAll() { - ::grpc::Service::MarkMethodAsync(4); + ::grpc::Service::MarkMethodAsync(3); } ~WithAsyncMethod_SubscribeClearAll() override { BaseClassMustBeDerivedFromService(this); @@ -336,10 +282,10 @@ class MissionRawServerService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSubscribeClearAll(::grpc::ServerContext* context, ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest* request, ::grpc::ServerAsyncWriter< ::mavsdk::rpc::mission_raw_server::ClearAllResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(4, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_SubscribeIncomingMission > > > > AsyncService; + typedef WithAsyncMethod_SubscribeIncomingMission > > > AsyncService; template class WithCallbackMethod_SubscribeIncomingMission : public BaseClass { private: @@ -363,34 +309,12 @@ class MissionRawServerService final { ::grpc::CallbackServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest* /*request*/) { return nullptr; } }; template - class WithCallbackMethod_SubscribeOutgoingMission : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_SubscribeOutgoingMission() { - ::grpc::Service::MarkMethodCallback(1, - new ::grpc::internal::CallbackServerStreamingHandler< ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest, ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* request) { return this->SubscribeOutgoingMission(context, request); })); - } - ~WithCallbackMethod_SubscribeOutgoingMission() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* /*writer*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerWriteReactor< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* SubscribeOutgoingMission( - ::grpc::CallbackServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/) { return nullptr; } - }; - template class WithCallbackMethod_SubscribeCurrentItemChanged : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SubscribeCurrentItemChanged() { - ::grpc::Service::MarkMethodCallback(2, + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackServerStreamingHandler< ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest, ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* request) { return this->SubscribeCurrentItemChanged(context, request); })); @@ -412,13 +336,13 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SetCurrentItemComplete() { - ::grpc::Service::MarkMethodCallback(3, + ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest* request, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse* response) { return this->SetCurrentItemComplete(context, request, response); }));} void SetMessageAllocatorFor_SetCurrentItemComplete( ::grpc::MessageAllocator< ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -439,7 +363,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SubscribeClearAll() { - ::grpc::Service::MarkMethodCallback(4, + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackServerStreamingHandler< ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest, ::mavsdk::rpc::mission_raw_server::ClearAllResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest* request) { return this->SubscribeClearAll(context, request); })); @@ -455,7 +379,7 @@ class MissionRawServerService final { virtual ::grpc::ServerWriteReactor< ::mavsdk::rpc::mission_raw_server::ClearAllResponse>* SubscribeClearAll( ::grpc::CallbackServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest* /*request*/) { return nullptr; } }; - typedef WithCallbackMethod_SubscribeIncomingMission > > > > CallbackService; + typedef WithCallbackMethod_SubscribeIncomingMission > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_SubscribeIncomingMission : public BaseClass { @@ -475,29 +399,12 @@ class MissionRawServerService final { } }; template - class WithGenericMethod_SubscribeOutgoingMission : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_SubscribeOutgoingMission() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_SubscribeOutgoingMission() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* /*writer*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template class WithGenericMethod_SubscribeCurrentItemChanged : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SubscribeCurrentItemChanged() { - ::grpc::Service::MarkMethodGeneric(2); + ::grpc::Service::MarkMethodGeneric(1); } ~WithGenericMethod_SubscribeCurrentItemChanged() override { BaseClassMustBeDerivedFromService(this); @@ -514,7 +421,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SetCurrentItemComplete() { - ::grpc::Service::MarkMethodGeneric(3); + ::grpc::Service::MarkMethodGeneric(2); } ~WithGenericMethod_SetCurrentItemComplete() override { BaseClassMustBeDerivedFromService(this); @@ -531,7 +438,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SubscribeClearAll() { - ::grpc::Service::MarkMethodGeneric(4); + ::grpc::Service::MarkMethodGeneric(3); } ~WithGenericMethod_SubscribeClearAll() override { BaseClassMustBeDerivedFromService(this); @@ -563,32 +470,12 @@ class MissionRawServerService final { } }; template - class WithRawMethod_SubscribeOutgoingMission : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_SubscribeOutgoingMission() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_SubscribeOutgoingMission() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* /*writer*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSubscribeOutgoingMission(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); - } - }; - template class WithRawMethod_SubscribeCurrentItemChanged : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SubscribeCurrentItemChanged() { - ::grpc::Service::MarkMethodRaw(2); + ::grpc::Service::MarkMethodRaw(1); } ~WithRawMethod_SubscribeCurrentItemChanged() override { BaseClassMustBeDerivedFromService(this); @@ -599,7 +486,7 @@ class MissionRawServerService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSubscribeCurrentItemChanged(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(2, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -608,7 +495,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SetCurrentItemComplete() { - ::grpc::Service::MarkMethodRaw(3); + ::grpc::Service::MarkMethodRaw(2); } ~WithRawMethod_SetCurrentItemComplete() override { BaseClassMustBeDerivedFromService(this); @@ -619,7 +506,7 @@ class MissionRawServerService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetCurrentItemComplete(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -628,7 +515,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SubscribeClearAll() { - ::grpc::Service::MarkMethodRaw(4); + ::grpc::Service::MarkMethodRaw(3); } ~WithRawMethod_SubscribeClearAll() override { BaseClassMustBeDerivedFromService(this); @@ -639,7 +526,7 @@ class MissionRawServerService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSubscribeClearAll(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(4, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(3, context, request, writer, new_call_cq, notification_cq, tag); } }; template @@ -665,34 +552,12 @@ class MissionRawServerService final { ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template - class WithRawCallbackMethod_SubscribeOutgoingMission : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_SubscribeOutgoingMission() { - ::grpc::Service::MarkMethodRawCallback(1, - new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->SubscribeOutgoingMission(context, request); })); - } - ~WithRawCallbackMethod_SubscribeOutgoingMission() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* /*writer*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* SubscribeOutgoingMission( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } - }; - template class WithRawCallbackMethod_SubscribeCurrentItemChanged : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SubscribeCurrentItemChanged() { - ::grpc::Service::MarkMethodRawCallback(2, + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->SubscribeCurrentItemChanged(context, request); })); @@ -714,7 +579,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SetCurrentItemComplete() { - ::grpc::Service::MarkMethodRawCallback(3, + ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SetCurrentItemComplete(context, request, response); })); @@ -736,7 +601,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SubscribeClearAll() { - ::grpc::Service::MarkMethodRawCallback(4, + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->SubscribeClearAll(context, request); })); @@ -758,7 +623,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SetCurrentItemComplete() { - ::grpc::Service::MarkMethodStreamed(3, + ::grpc::Service::MarkMethodStreamed(2, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteRequest, ::mavsdk::rpc::mission_raw_server::SetCurrentItemCompleteResponse>( [this](::grpc::ServerContext* context, @@ -808,39 +673,12 @@ class MissionRawServerService final { virtual ::grpc::Status StreamedSubscribeIncomingMission(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::mavsdk::rpc::mission_raw_server::SubscribeIncomingMissionRequest,::mavsdk::rpc::mission_raw_server::IncomingMissionResponse>* server_split_streamer) = 0; }; template - class WithSplitStreamingMethod_SubscribeOutgoingMission : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithSplitStreamingMethod_SubscribeOutgoingMission() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::SplitServerStreamingHandler< - ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest, ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerSplitStreamer< - ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest, ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* streamer) { - return this->StreamedSubscribeOutgoingMission(context, - streamer); - })); - } - ~WithSplitStreamingMethod_SubscribeOutgoingMission() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status SubscribeOutgoingMission(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /*request*/, ::grpc::ServerWriter< ::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* /*writer*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with split streamed - virtual ::grpc::Status StreamedSubscribeOutgoingMission(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest,::mavsdk::rpc::mission_raw_server::OutgoingMissionResponse>* server_split_streamer) = 0; - }; - template class WithSplitStreamingMethod_SubscribeCurrentItemChanged : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_SubscribeCurrentItemChanged() { - ::grpc::Service::MarkMethodStreamed(2, + ::grpc::Service::MarkMethodStreamed(1, new ::grpc::internal::SplitServerStreamingHandler< ::mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest, ::mavsdk::rpc::mission_raw_server::CurrentItemChangedResponse>( [this](::grpc::ServerContext* context, @@ -867,7 +705,7 @@ class MissionRawServerService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_SubscribeClearAll() { - ::grpc::Service::MarkMethodStreamed(4, + ::grpc::Service::MarkMethodStreamed(3, new ::grpc::internal::SplitServerStreamingHandler< ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest, ::mavsdk::rpc::mission_raw_server::ClearAllResponse>( [this](::grpc::ServerContext* context, @@ -888,8 +726,8 @@ class MissionRawServerService final { // replace default version of method with split streamed virtual ::grpc::Status StreamedSubscribeClearAll(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::mavsdk::rpc::mission_raw_server::SubscribeClearAllRequest,::mavsdk::rpc::mission_raw_server::ClearAllResponse>* server_split_streamer) = 0; }; - typedef WithSplitStreamingMethod_SubscribeIncomingMission > > > SplitStreamedService; - typedef WithSplitStreamingMethod_SubscribeIncomingMission > > > > StreamedService; + typedef WithSplitStreamingMethod_SubscribeIncomingMission > > SplitStreamedService; + typedef WithSplitStreamingMethod_SubscribeIncomingMission > > > StreamedService; }; } // namespace mission_raw_server diff --git a/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.pb.cc b/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.pb.cc index bbca0db2a..bd64e474e 100644 --- a/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.pb.cc +++ b/src/mavsdk_server/src/generated/mission_raw_server/mission_raw_server.pb.cc @@ -506,25 +506,25 @@ const char descriptor_table_protodef_mission_5fraw_5fserver_2fmission_5fraw_5fse "ULT_UNSUPPORTED\020\007\022\037\n\033RESULT_NO_MISSION_A" "VAILABLE\020\010\022\"\n\036RESULT_UNSUPPORTED_MISSION" "_CMD\020\013\022\035\n\031RESULT_TRANSFER_CANCELLED\020\014\022\024\n" - "\020RESULT_NO_SYSTEM\020\r\022\017\n\013RESULT_NEXT\020\0162\366\004\n" - "\027MissionRawServerService\022\226\001\n\030SubscribeIn" + "\020RESULT_NO_SYSTEM\020\r\022\017\n\013RESULT_NEXT\020\0162\202\005\n" + "\027MissionRawServerService\022\232\001\n\030SubscribeIn" "comingMission\022>.mavsdk.rpc.mission_raw_s" "erver.SubscribeIncomingMissionRequest\0326." "mavsdk.rpc.mission_raw_server.IncomingMi" - "ssionResponse\"\0000\001\022\237\001\n\033SubscribeCurrentIt" - "emChanged\022A.mavsdk.rpc.mission_raw_serve" - "r.SubscribeCurrentItemChangedRequest\0329.m" - "avsdk.rpc.mission_raw_server.CurrentItem" - "ChangedResponse\"\0000\001\022\233\001\n\026SetCurrentItemCo" - "mplete\022<.mavsdk.rpc.mission_raw_server.S" - "etCurrentItemCompleteRequest\032=.mavsdk.rp" - "c.mission_raw_server.SetCurrentItemCompl" - "eteResponse\"\004\200\265\030\001\022\201\001\n\021SubscribeClearAll\022" - "7.mavsdk.rpc.mission_raw_server.Subscrib" - "eClearAllRequest\032/.mavsdk.rpc.mission_ra" - "w_server.ClearAllResponse\"\0000\001B5\n\034io.mavs" - "dk.mission_raw_serverB\025MissionRawServerP" - "rotob\006proto3" + "ssionResponse\"\004\200\265\030\0000\001\022\243\001\n\033SubscribeCurre" + "ntItemChanged\022A.mavsdk.rpc.mission_raw_s" + "erver.SubscribeCurrentItemChangedRequest" + "\0329.mavsdk.rpc.mission_raw_server.Current" + "ItemChangedResponse\"\004\200\265\030\0000\001\022\233\001\n\026SetCurre" + "ntItemComplete\022<.mavsdk.rpc.mission_raw_" + "server.SetCurrentItemCompleteRequest\032=.m" + "avsdk.rpc.mission_raw_server.SetCurrentI" + "temCompleteResponse\"\004\200\265\030\001\022\205\001\n\021SubscribeC" + "learAll\0227.mavsdk.rpc.mission_raw_server." + "SubscribeClearAllRequest\032/.mavsdk.rpc.mi" + "ssion_raw_server.ClearAllResponse\"\004\200\265\030\0000" + "\001B5\n\034io.mavsdk.mission_raw_serverB\025Missi" + "onRawServerProtob\006proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_mission_5fraw_5fserver_2fmission_5fraw_5fserver_2eproto_deps[1] = { @@ -534,7 +534,7 @@ static ::absl::once_flag descriptor_table_mission_5fraw_5fserver_2fmission_5fraw PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_mission_5fraw_5fserver_2fmission_5fraw_5fserver_2eproto = { false, false, - 2092, + 2104, descriptor_table_protodef_mission_5fraw_5fserver_2fmission_5fraw_5fserver_2eproto, "mission_raw_server/mission_raw_server.proto", &descriptor_table_mission_5fraw_5fserver_2fmission_5fraw_5fserver_2eproto_once, diff --git a/src/mavsdk_server/src/plugins/mission_raw_server/mission_raw_server_service_impl.h b/src/mavsdk_server/src/plugins/mission_raw_server/mission_raw_server_service_impl.h index 7c878abab..b921a7992 100644 --- a/src/mavsdk_server/src/plugins/mission_raw_server/mission_raw_server_service_impl.h +++ b/src/mavsdk_server/src/plugins/mission_raw_server/mission_raw_server_service_impl.h @@ -304,66 +304,6 @@ class MissionRawServerServiceImpl final return grpc::Status::OK; } - grpc::Status SubscribeOutgoingMission( - grpc::ServerContext* /* context */, - const mavsdk::rpc::mission_raw_server::SubscribeOutgoingMissionRequest* /* request */, - grpc::ServerWriter* writer) override - { - if (_lazy_plugin.maybe_plugin() == nullptr) { - rpc::mission_raw_server::OutgoingMissionResponse rpc_response; - - // For server plugins, this should never happen, they should always be constructible. - auto result = mavsdk::MissionRawServer::Result::Unknown; - fillResponseWithResult(&rpc_response, result); - writer->Write(rpc_response); - - return grpc::Status::OK; - } - - auto stream_closed_promise = std::make_shared>(); - auto stream_closed_future = stream_closed_promise->get_future(); - register_stream_stop_promise(stream_closed_promise); - - auto is_finished = std::make_shared(false); - auto subscribe_mutex = std::make_shared(); - - const mavsdk::MissionRawServer::OutgoingMissionHandle handle = - _lazy_plugin.maybe_plugin()->subscribe_outgoing_mission( - [this, &writer, &stream_closed_promise, is_finished, subscribe_mutex, &handle]( - mavsdk::MissionRawServer::Result result, - const mavsdk::MissionRawServer::MissionPlan outgoing_mission) { - rpc::mission_raw_server::OutgoingMissionResponse rpc_response; - - rpc_response.set_allocated_mission_plan( - translateToRpcMissionPlan(outgoing_mission).release()); - - auto rpc_result = translateToRpcResult(result); - auto* rpc_mission_raw_server_result = - new rpc::mission_raw_server::MissionRawServerResult(); - rpc_mission_raw_server_result->set_result(rpc_result); - std::stringstream ss; - ss << result; - rpc_mission_raw_server_result->set_result_str(ss.str()); - rpc_response.set_allocated_mission_raw_server_result( - rpc_mission_raw_server_result); - - std::unique_lock lock(*subscribe_mutex); - if (!*is_finished && !writer->Write(rpc_response)) { - _lazy_plugin.maybe_plugin()->unsubscribe_outgoing_mission(handle); - - *is_finished = true; - unregister_stream_stop_promise(stream_closed_promise); - stream_closed_promise->set_value(); - } - }); - - stream_closed_future.wait(); - std::unique_lock lock(*subscribe_mutex); - *is_finished = true; - - return grpc::Status::OK; - } - grpc::Status SubscribeCurrentItemChanged( grpc::ServerContext* /* context */, const mavsdk::rpc::mission_raw_server::SubscribeCurrentItemChangedRequest* /* request */,