1 /* 2 * Copyright (c) 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_TRUSTED_DEVICE_INFO_H 17 #define OHOS_DP_TRUSTED_DEVICE_INFO_H 18 19 #include <string> 20 #include "distributed_device_profile_constants.h" 21 #include "dp_parcel.h" 22 23 namespace OHOS { 24 namespace DistributedDeviceProfile { 25 class TrustedDeviceInfo : public DpParcel { 26 public: TrustedDeviceInfo()27 TrustedDeviceInfo() : networkId_(""), authForm_(BINDTYPE_INIT), deviceTypeId_(0), 28 osVersion_(""), osType_(0), udid_(""), uuid_("") 29 {} 30 ~TrustedDeviceInfo() = default; 31 32 std::string GetNetworkId() const; 33 void SetNetworkId(const std::string& networkId); 34 int32_t GetAuthForm() const; 35 void SetAuthForm(int32_t authForm); 36 uint16_t GetDeviceTypeId() const; 37 void SetDeviceTypeId(uint16_t deviceTypeId); 38 std::string GetOsVersion() const; 39 void SetOsVersion(const std::string& osVersion); 40 int32_t GetOsType() const; 41 void SetOsType(int32_t osType); 42 std::string GetUdid() const; 43 void SetUdid(const std::string& udid); 44 std::string GetUuid() const; 45 void SetUuid(const std::string& uuid); 46 47 bool operator!=(const TrustedDeviceInfo& trustedDeviceInfo) const; 48 bool operator<(const TrustedDeviceInfo& trustedDeviceInfo) const; 49 bool Marshalling(MessageParcel& parcel) const override; 50 bool UnMarshalling(MessageParcel& parcel) override; 51 std::string dump() const override; 52 53 private: 54 std::string networkId_; 55 std::int32_t authForm_; 56 std::uint16_t deviceTypeId_; 57 std::string osVersion_; 58 std::int32_t osType_; 59 std::string udid_; 60 std::string uuid_; 61 }; 62 } // namespace DistributedDeviceProfile 63 } // namespace OHOS 64 #endif // OHOS_DP_TRUSTED_DEVICE_INFO_H 65