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 #ifndef OHOS_IDCALL_CLIENT_H 17 #define OHOS_IDCALL_CLIENT_H 18 19 #include <cstdint> 20 #include <iostream> 21 #include <string> 22 23 #include "idcall_device_callback.h" 24 #include "dcall/dcall_device_info.h" 25 26 namespace OHOS { 27 namespace DistributedHardware { 28 const std::string DCALL_LOADER_GET_DCALL_CLIENT_HANDLER = "GetDCallClientInstance"; 29 30 class IDCallClient { 31 public: 32 virtual ~IDCallClient() = default; 33 virtual int32_t Init() = 0; 34 virtual int32_t UnInit() = 0; 35 virtual int32_t SwitchDevice(const std::string& devId, int32_t flag) = 0; 36 virtual int32_t GetOnlineDeviceList(std::vector<std::string>& devList) = 0; 37 virtual int32_t RegisterDeviceCallback(const std::string name, 38 const std::shared_ptr<IDCallDeviceCallback>& callback) = 0; 39 virtual int32_t UnRegisterDeviceCallback(const std::string& name) = 0; 40 virtual int32_t GetDCallDeviceInfo(const std::string &devId, DCallDeviceInfo& devInfo) = 0; 41 }; 42 43 extern "C" __attribute__((visibility("default"))) IDCallClient* GetDCallClientInstance(); 44 45 } // DistributedHardware 46 } // OHOS 47 #endif // OHOS_IDCALL_CLIENT_H 48