1 /* 2 * Copyright (c) 2023-2024 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_DP_I_DISTRIBUTED_DEVICE_PROFILE_H 17 #define OHOS_DP_I_DISTRIBUTED_DEVICE_PROFILE_H 18 19 #include <list> 20 21 #include "iremote_broker.h" 22 #include "trust_device_profile.h" 23 #include "access_control_profile.h" 24 #include "device_profile.h" 25 #include "service_profile.h" 26 #include "characteristic_profile.h" 27 #include "dp_subscribe_info.h" 28 #include "dp_sync_options.h" 29 #include "i_sync_completed_callback.h" 30 31 namespace OHOS { 32 namespace DistributedDeviceProfile { 33 class IDistributedDeviceProfile : public OHOS::IRemoteBroker { 34 public: 35 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.DeviceProfile.IDistributedDeviceProfile"); 36 IDistributedDeviceProfile() = default; 37 virtual ~IDistributedDeviceProfile() = default; 38 virtual int32_t PutAccessControlProfile(const AccessControlProfile& aclProfile) = 0; 39 virtual int32_t UpdateAccessControlProfile(const AccessControlProfile& aclProfile) = 0; 40 virtual int32_t GetTrustDeviceProfile(const std::string& deviceId, TrustDeviceProfile& trustDeviceProfile) = 0; 41 virtual int32_t GetAllTrustDeviceProfile(std::vector<TrustDeviceProfile>& trustDeviceProfiles) = 0; 42 virtual int32_t GetAccessControlProfile(std::map<std::string, std::string> queryParams, 43 std::vector<AccessControlProfile>& accessControlProfiles) = 0; 44 virtual int32_t GetAllAccessControlProfile(std::vector<AccessControlProfile>& accessControlProfiles) = 0; 45 virtual int32_t DeleteAccessControlProfile(int32_t accessControlId) = 0; 46 virtual int32_t PutServiceProfile(const ServiceProfile& serviceProfile) = 0; 47 virtual int32_t PutServiceProfileBatch(const std::vector<ServiceProfile>& serviceProfiles) = 0; 48 virtual int32_t PutCharacteristicProfile(const CharacteristicProfile& charProfile) = 0; 49 virtual int32_t PutCharacteristicProfileBatch(const std::vector<CharacteristicProfile>& charProfiles) = 0; 50 virtual int32_t GetDeviceProfile(const std::string& deviceId, DeviceProfile& deviceProfile) = 0; 51 virtual int32_t GetServiceProfile(const std::string& deviceId, const std::string& serviceName, 52 ServiceProfile& serviceProfile) = 0; 53 virtual int32_t GetCharacteristicProfile(const std::string& deviceId, const std::string& serviceName, 54 const std::string& characteristicId, CharacteristicProfile& charProfile) = 0; 55 virtual int32_t DeleteServiceProfile(const std::string& deviceId, const std::string& serviceName) = 0; 56 virtual int32_t DeleteCharacteristicProfile(const std::string& deviceId, const std::string& serviceName, 57 const std::string& characteristicId) = 0; 58 virtual int32_t SubscribeDeviceProfile(const SubscribeInfo& subscribeInfo) = 0; 59 virtual int32_t UnSubscribeDeviceProfile(const SubscribeInfo& subscribeInfo) = 0; 60 virtual int32_t SubscribeDeviceProfileInited(int32_t saId, sptr<IRemoteObject> dpInitedCallback) = 0; 61 virtual int32_t UnSubscribeDeviceProfileInited(int32_t saId) = 0; 62 virtual int32_t SyncDeviceProfile(const DistributedDeviceProfile::DpSyncOptions& syncOptions, 63 sptr<IRemoteObject> syncCompletedCallback) = 0; 64 virtual int32_t SendSubscribeInfos(std::map<std::string, SubscribeInfo> listenerMap) = 0; 65 }; 66 } // namespace DistributedDeviceProfile 67 } // namespace OHOS 68 #endif // OHOS_DP_I_DISTRIBUTED_DEVICE_PROFILE_H 69