1 /* 2 * Copyright (c) 2025 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_SERVICE_INFO_PROFILE_H 17 #define OHOS_DP_SERVICE_INFO_PROFILE_H 18 19 #include <cstdint> 20 #include <string> 21 22 #include "distributed_device_profile_constants.h" 23 #include "dp_parcel.h" 24 25 namespace OHOS { 26 namespace DistributedDeviceProfile { 27 class ServiceInfoProfile : public DpParcel { 28 public: ServiceInfoProfile(const std::string & deviceId,const int32_t userId,const std::string & networkId,const std::string & tokenId,const int64_t serviceId,const std::string & serviceType,const std::string & serviceName,const std::string & serviceDisplayName,const std::string & customData,const int32_t customDataLen,const std::string & bundleName,const std::string & moduleName,const std::string abilityName,const int32_t authBoxType,const int32_t authType,const int32_t pinExchangeType,const std::string & pinCode,const std::string & description,const std::string & serviceDicoveryScope,const std::string & extraInfo)29 ServiceInfoProfile(const std::string& deviceId, const int32_t userId, const std::string& networkId, 30 const std::string& tokenId, const int64_t serviceId, const std::string& serviceType, 31 const std::string& serviceName, const std::string& serviceDisplayName, const std::string& customData, 32 const int32_t customDataLen, const std::string& bundleName, const std::string& moduleName, 33 const std::string abilityName, const int32_t authBoxType, const int32_t authType, const int32_t pinExchangeType, 34 const std::string& pinCode, const std::string& description, const std::string& serviceDicoveryScope, 35 const std::string& extraInfo) 36 : deviceId_(deviceId), 37 userId_(userId), 38 networkId_(networkId), 39 tokenId_(tokenId), 40 serviceId_(serviceId), 41 serviceType_(serviceType), 42 serviceName_(serviceName), 43 serviceDisplayName_(serviceDisplayName), 44 customData_(customData), 45 customDataLen_(customDataLen), 46 bundleName_(bundleName), 47 moduleName_(moduleName), 48 abilityName_(abilityName), 49 authBoxType_(authBoxType), 50 authType_(authType), 51 pinExchangeType_(pinExchangeType), 52 pinCode_(pinCode), 53 description_(description), 54 serviceDicoveryScope_(serviceDicoveryScope), 55 extraInfo_(extraInfo) 56 {} 57 ServiceInfoProfile(); 58 ~ServiceInfoProfile(); 59 60 std::string GetDeviceId() const; 61 void SetDeviceId(const std::string& deviceId); 62 int32_t GetUserId() const; 63 void SetUserId(const int32_t userId); 64 std::string GetNetworkId() const; 65 void SetNetworkId(const std::string& networkId); 66 std::string GetTokenId() const; 67 void SetTokenId(const std::string& tokenId); 68 int64_t GetServiceId() const; 69 void SetServiceId(const int64_t serviceId); 70 std::string GetServiceType() const; 71 void SetServiceType(const std::string& serviceType); 72 std::string GetServiceName() const; 73 void SetServiceName(const std::string& serviceName); 74 std::string GetServiceDisplayName() const; 75 void SetServiceDisplayName(const std::string& serviceDisplayName); 76 std::string GetCustomData() const; 77 void SetCustomData(const std::string& customData); 78 int32_t GetCustomDataLen() const; 79 void SetCustomDataLen(const int32_t customDataLen); 80 std::string GetBundleName() const; 81 void SetBundleName(const std::string& bundleName); 82 std::string GetModuleName() const; 83 void SetModuleName(const std::string& moduleName); 84 std::string GetAbilityName() const; 85 void SetAbilityName(const std::string& abilityName); 86 int32_t GetAuthBoxType() const; 87 void SetAuthBoxType(const int32_t authBoxType); 88 int32_t GetAuthType() const; 89 void SetAuthType(const int32_t authType); 90 int32_t GetPinExchangeType() const; 91 void SetPinExchangeType(const int32_t pinExchangeType); 92 std::string GetPinCode() const; 93 void SetPinCode(const std::string& pinCode); 94 std::string GetDescription() const; 95 void SetDescription(const std::string& description); 96 std::string GetServiceDicoveryScope() const; 97 void SetServiceDicoveryScope(const std::string& serviceDicoveryScope); 98 std::string GetExtraInfo() const; 99 void SetExtraInfo(const std::string& extraInfo); 100 101 bool Marshalling(MessageParcel& parcel) const override; 102 bool UnMarshalling(MessageParcel& parcel) override; 103 std::string dump() const override; 104 105 private: 106 std::string deviceId_ = ""; 107 int32_t userId_ = DEFAULT_USER_ID; 108 std::string networkId_ = ""; 109 std::string tokenId_ = ""; 110 int64_t serviceId_ = DEFAULT_SERVICE_ID; 111 std::string serviceType_ = ""; 112 std::string serviceName_ = ""; 113 std::string serviceDisplayName_ = ""; 114 std::string customData_ = ""; 115 int32_t customDataLen_ = 0; 116 std::string bundleName_ = ""; 117 std::string moduleName_ = ""; 118 std::string abilityName_ = ""; 119 int32_t authBoxType_ = 0; 120 int32_t authType_ = 0; 121 int32_t pinExchangeType_ = 0; 122 std::string pinCode_ = ""; 123 std::string description_ = ""; 124 std::string serviceDicoveryScope_ = ""; 125 std::string extraInfo_ = ""; 126 }; 127 } // namespace DistributedDeviceProfile 128 } // namespace OHOS 129 #endif //OHOS_DP_SERVICE_INFO_PROFILE_H 130