• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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         serialNumberId_(""),
35         storageCapability_(0),
36         osSysCap_(""),
37         osApiLevel_(0),
38         osVersion_(""),
39         osType_(0)
40     {}
41     ~DeviceProfile() = default;
42 
43     std::string GetDeviceId() const;
44     void SetDeviceId(const std::string& deviceId);
45     std::string GetDeviceTypeName() const;
46     void SetDeviceTypeName(const std::string& deviceTypeName);
47     int32_t GetDeviceTypeId() const;
48     void SetDeviceTypeId(int32_t deviceTypeId);
49     std::string GetDeviceName() const;
50     void SetDeviceName(const std::string& deviceName);
51     std::string GetManufactureName() const;
52     void SetManufactureName(std::string manufactureName);
53     std::string GetDeviceModel() const;
54     void SetDeviceModel(const std::string& deviceModel);
55     std::string GetSerialNumberId() const;
56     void SetSerialNumberId(const std::string& serialNumberId);
57     int64_t GetStorageCapability() const;
58     void SetStorageCapability(int64_t storageCapability);
59     std::string GetOsSysCap() const;
60     void SetOsSysCap(const std::string& osSysCap);
61     int32_t GetOsApiLevel() const;
62     void SetOsApiLevel(int32_t osApiLevel);
63     std::string GetOsVersion() const;
64     void SetOsVersion(const std::string& osVersion);
65     int32_t GetOsType() const;
66     void SetOsType(int32_t osType);
67     bool Marshalling(MessageParcel& parcel) const override;
68     bool UnMarshalling(MessageParcel& parcel) override;
69     bool operator!=(const DeviceProfile& deviceProfile) const;
70     std::string dump() const override;
71 
72 private:
73     std::string deviceId_;
74     std::string deviceTypeName_;
75     int32_t deviceTypeId_;
76     std::string deviceName_;
77     std::string manufactureName_;
78     std::string deviceModel_;
79     std::string serialNumberId_;
80     int64_t storageCapability_;
81     std::string osSysCap_;
82     int32_t osApiLevel_;
83     std::string osVersion_;
84     int32_t osType_;
85 };
86 } // namespace DistributedDeviceProfile
87 } // namespace OHOS
88 #endif //OHOS_DP_DEVICE_PROFILE_H
89