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 "dp_parcel.h"
22 
23 namespace OHOS {
24 namespace DistributedDeviceProfile {
25 class DeviceProfile : public DpParcel {
26 public:
DeviceProfile()27     DeviceProfile()
28         : deviceId_(""),
29         deviceTypeName_(""),
30         deviceTypeId_(0),
31         deviceName_(""),
32         manufactureName_(""),
33         deviceModel_(""),
34         storageCapability_(0),
35         osSysCap_(""),
36         osApiLevel_(0),
37         osVersion_(""),
38         osType_(0)
39     {}
40     ~DeviceProfile() = default;
41 
42     std::string GetDeviceId() const;
43     void SetDeviceId(const std::string& deviceId);
44     std::string GetDeviceTypeName() const;
45     void SetDeviceTypeName(const std::string& deviceTypeName);
46     int32_t GetDeviceTypeId() const;
47     void SetDeviceTypeId(int32_t deviceTypeId);
48     std::string GetDeviceName() const;
49     void SetDeviceName(const std::string& deviceName);
50     std::string GetManufactureName() const;
51     void SetManufactureName(std::string manufactureName);
52     std::string GetDeviceModel() const;
53     void SetDeviceModel(const std::string& deviceModel);
54     int64_t GetStorageCapability() const;
55     void SetStorageCapability(int64_t storageCapability);
56     std::string GetOsSysCap() const;
57     void SetOsSysCap(const std::string& osSysCap);
58     int32_t GetOsApiLevel() const;
59     void SetOsApiLevel(int32_t osApiLevel);
60     std::string GetOsVersion() const;
61     void SetOsVersion(const std::string& osVersion);
62     int32_t GetOsType() const;
63     void SetOsType(int32_t osType);
64     bool Marshalling(MessageParcel& parcel) const override;
65     bool UnMarshalling(MessageParcel& parcel) override;
66     bool operator!=(const DeviceProfile& deviceProfile) const;
67     std::string dump() const override;
68     std::string AnnoymizeDump() const;
69 
70 private:
71     std::string deviceId_;
72     std::string deviceTypeName_;
73     int32_t deviceTypeId_;
74     std::string deviceName_;
75     std::string manufactureName_;
76     std::string deviceModel_;
77     int64_t storageCapability_;
78     std::string osSysCap_;
79     int32_t osApiLevel_;
80     std::string osVersion_;
81     int32_t osType_;
82 };
83 } // namespace DistributedDeviceProfile
84 } // namespace OHOS
85 #endif //OHOS_DP_DEVICE_PROFILE_H
86