// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef CORE_INTERNAL_SERVICE_CONTROLLER_H_ #define CORE_INTERNAL_SERVICE_CONTROLLER_H_ #include #include #include "core/internal/client_proxy.h" #include "core/listeners.h" #include "core/options.h" #include "core/payload.h" #include "core/status.h" #include "platform/port/string.h" #include "platform/ptr.h" namespace location { namespace nearby { namespace connections { template class ServiceController { public: virtual ~ServiceController() {} virtual Status::Value startAdvertising( Ptr > client_proxy, const std::string& endpoint_name, const std::string& service_id, const AdvertisingOptions& advertising_options, Ptr connection_lifecycle_listener) = 0; virtual void stopAdvertising(Ptr > client_proxy) = 0; virtual Status::Value startDiscovery( Ptr > client_proxy, const std::string& service_id, const DiscoveryOptions& discovery_options, Ptr discovery_listener) = 0; virtual void stopDiscovery(Ptr > client_proxy) = 0; virtual Status::Value requestConnection( Ptr > client_proxy, const std::string& endpoint_name, const std::string& endpoint_id, Ptr connection_lifecycle_listener) = 0; virtual Status::Value acceptConnection( Ptr > client_proxy, const std::string& endpoint_id, Ptr payload_listener) = 0; virtual Status::Value rejectConnection( Ptr > client_proxy, const std::string& endpoint_id) = 0; virtual void initiateBandwidthUpgrade( Ptr > client_proxy, const std::string& endpoint_id) = 0; virtual void sendPayload(Ptr > client_proxy, const std::vector& endpoint_ids, ConstPtr payload) = 0; virtual Status::Value cancelPayload(Ptr > client_proxy, std::int64_t payload_id) = 0; virtual void disconnectFromEndpoint(Ptr > client_proxy, const std::string& endpoint_id) = 0; }; } // namespace connections } // namespace nearby } // namespace location #endif // CORE_INTERNAL_SERVICE_CONTROLLER_H_