1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 // Implementation of client side of IPC. 17 18 #ifndef I_TUNNEL_CLIENT_H 19 #define I_TUNNEL_CLIENT_H 20 21 #include "intention_identity.h" 22 23 namespace OHOS { 24 namespace Msdp { 25 namespace DeviceStatus { 26 27 class ITunnelClient { 28 public: 29 virtual ~ITunnelClient() = default; 30 31 // Request to enable the service identified by [`intention`]. 32 virtual int32_t Enable(Intention intention, ParamBase &data, ParamBase &reply) = 0; 33 // Request to disable the service identified by [`intention`]. 34 virtual int32_t Disable(Intention intention, ParamBase &data, ParamBase &reply) = 0; 35 // Request to start the service identified by [`intention`]. 36 virtual int32_t Start(Intention intention, ParamBase &data, ParamBase &reply) = 0; 37 // Request to stop the service identified by [`intention`]. 38 virtual int32_t Stop(Intention intention, ParamBase &data, ParamBase &reply) = 0; 39 // Request to add a watch of state of service, with the service identified by 40 // [`intention`], the state to watch identified by [`id`], parameters packed in 41 // [`data`] parcel. 42 virtual int32_t AddWatch(Intention intention, uint32_t id, ParamBase &data, ParamBase &reply) = 0; 43 // Request to remove a watch of state of service. 44 virtual int32_t RemoveWatch(Intention intention, uint32_t id, ParamBase &data, ParamBase &reply) = 0; 45 // Request to set a parameter of service, with the service identified by 46 // [`intention`], the parameter identified by [`id`], and values packed in 47 // [`data`] parcel. 48 virtual int32_t SetParam(Intention intention, uint32_t id, ParamBase &data, ParamBase &reply) = 0; 49 // Request to get a parameter of service, with the service identified by 50 // [`intention`], the parameter identified by [`id`]. 51 virtual int32_t GetParam(Intention intention, uint32_t id, ParamBase &data, ParamBase &reply) = 0; 52 // Request to interact with service identified by [`intention`] for general purpose. 53 // This interface supplements functions of previous intefaces. Functionalities of 54 // this interface is service spicific. 55 virtual int32_t Control(Intention intention, uint32_t id, ParamBase &data, ParamBase &reply) = 0; 56 }; 57 } // namespace DeviceStatus 58 } // namespace Msdp 59 } // namespace OHOS 60 #endif // I_TUNNEL_CLIENT_H 61