• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DEVICE_PROFILE_H
17 #define OHOS_DP_DEVICE_PROFILE_H
18 
19 #include <cstdint>
20 #include <string>
21 #include "distributed_device_profile_constants.h"
22 #include "dp_parcel.h"
23 
24 namespace OHOS {
25 namespace DistributedDeviceProfile {
26 class DeviceProfile : public DpParcel {
27 public:
DeviceProfile()28     DeviceProfile()
29         : deviceId_(""),
30         deviceName_(""),
31         manufactureName_(""),
32         deviceModel_(""),
33         storageCapability_(0),
34         osSysCap_(""),
35         osApiLevel_(0),
36         osVersion_(""),
37         osType_(0),
38         isMultiUser_(false),
39         userId_(DEFAULT_USER_ID),
40         id_(0),
41         devType_(""),
42         manu_(""),
43         sn_(""),
44         productId_(""),
45         productName_(""),
46         subProductId_(""),
47         hiv_(""),
48         mac_(""),
49         fwv_(""),
50         hwv_(""),
51         swv_(""),
52         protType_(0),
53         wiseUserId_(""),
54         wiseDeviceId_(""),
55         registerTime_(""),
56         modifyTime_(""),
57         shareTime_(""),
58         accountId_(""),
59         bleMac_(""),
60         brMac_(""),
61         sleMac_(""),
62         setupType_(0),
63         internalModel_("")
64     {}
65     ~DeviceProfile() = default;
66 
67     std::string GetDeviceId() const;
68     void SetDeviceId(const std::string& deviceId);
69     std::string GetDeviceName() const;
70     void SetDeviceName(const std::string& deviceName);
71     std::string GetManufactureName() const;
72     void SetManufactureName(std::string manufactureName);
73     std::string GetDeviceModel() const;
74     void SetDeviceModel(const std::string& deviceModel);
75     int64_t GetStorageCapability() const;
76     void SetStorageCapability(int64_t storageCapability);
77     std::string GetOsSysCap() const;
78     void SetOsSysCap(const std::string& osSysCap);
79     int32_t GetOsApiLevel() const;
80     void SetOsApiLevel(int32_t osApiLevel);
81     std::string GetOsVersion() const;
82     void SetOsVersion(const std::string& osVersion);
83     int32_t GetOsType() const;
84     void SetOsType(int32_t osType);
85     bool IsMultiUser() const;
86     void SetIsMultiUser(bool isMultiUser);
87     int32_t GetUserId() const;
88     void SetUserId(int32_t userId);
89     int32_t GetId() const;
90     void SetId(int32_t id);
91     std::string GetDevType() const;
92     void SetDevType(const std::string& devType);
93     std::string GetManu() const;
94     void SetManu(const std::string& manu);
95     std::string GetSn() const;
96     void SetSn(const std::string& sn);
97     std::string GetProductId() const;
98     void SetProductId(const std::string& productId);
99     std::string GetProductName() const;
100     void SetProductName(const std::string& productName);
101     std::string GetSubProductId() const;
102     void SetSubProductId(const std::string& subProductId);
103     std::string GetHiv() const;
104     void SetHiv(const std::string& hiv);
105     std::string GetMac() const;
106     void SetMac(const std::string& mac);
107     std::string GetFwv() const;
108     void SetFwv(const std::string& fwv);
109     std::string GetHwv() const;
110     void SetHwv(const std::string& hwv);
111     std::string GetSwv() const;
112     void SetSwv(const std::string& swv);
113     int32_t GetProtType() const;
114     void SetProtType(int32_t protType);
115     std::string GetWiseUserId() const;
116     void SetWiseUserId(const std::string& wiseUserId);
117     std::string GetWiseDeviceId() const;
118     void SetWiseDeviceId(const std::string& wiseDeviceId);
119     std::string GetRegisterTime() const;
120     void SetRegisterTime(const std::string& registerTime);
121     std::string GetModifyTime() const;
122     void SetModifyTime(std::string modifyTime);
123     std::string GetShareTime() const;
124     void SetShareTime(const std::string& shareTime);
125     std::string GetAccountId() const;
126     void SetAccountId(const std::string& accountId);
127     std::string GetInternalModel() const;
128     void SetInternalModel(const std::string& internalModel);
129     bool Marshalling(MessageParcel& parcel) const override;
130     bool UnMarshalling(MessageParcel& parcel) override;
131     bool operator!=(const DeviceProfile& deviceProfile) const;
132     std::string dump() const override;
133     std::string AnnoymizeDump() const;
134     const std::string GetBleMac() const;
135     void SetBleMac(const std::string& bleMac);
136     const std::string GetBrMac() const;
137     void SetBrMac(const std::string& brMac);
138     const std::string GetSleMac() const;
139     void SetSleMac(const std::string& sleMac);
140     int32_t GetSetupType() const;
141     void SetSetupType(int32_t setupType);
142 private:
143     std::string deviceId_;
144     std::string deviceName_;
145     std::string manufactureName_;
146     std::string deviceModel_;
147     int64_t storageCapability_;
148     std::string osSysCap_;
149     int32_t osApiLevel_;
150     std::string osVersion_;
151     int32_t osType_;
152     bool isMultiUser_;
153     int32_t userId_;
154     int32_t id_;
155     std::string devType_;
156     std::string manu_;
157     std::string sn_;
158     std::string productId_;
159     std::string productName_ = "";
160     std::string subProductId_;
161     std::string hiv_;
162     std::string mac_;
163     std::string fwv_;
164     std::string hwv_;
165     std::string swv_;
166     int32_t protType_;
167     std::string wiseUserId_;
168     std::string wiseDeviceId_;
169     std::string registerTime_;
170     std::string modifyTime_;
171     std::string shareTime_;
172     std::string accountId_;
173     std::string bleMac_;
174     std::string brMac_;
175     std::string sleMac_;
176     int32_t setupType_;
177     std::string internalModel_;
178 };
179 } // namespace DistributedDeviceProfile
180 } // namespace OHOS
181 #endif // OHOS_DP_DEVICE_PROFILE_H
182