• 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_TRUST_DEVICE_PROFILE_H
17 #define OHOS_DP_TRUST_DEVICE_PROFILE_H
18 
19 #include <string>
20 #include "distributed_device_profile_enums.h"
21 #include "dp_parcel.h"
22 
23 namespace OHOS {
24 namespace DistributedDeviceProfile {
25 class TrustDeviceProfile : public DpParcel {
26 public:
TrustDeviceProfile()27     TrustDeviceProfile()
28         : deviceId_(""),
29         deviceIdType_(static_cast<uint32_t>(DeviceIdType::MIN)),
30         deviceIdHash_(""),
31         status_(static_cast<int32_t>(Status::MIN)),
32         bindType_(static_cast<uint32_t>(BindType::MIN)),
33         peerUserId_(-1),
34         localUserId_(-1)
35     {}
36     ~TrustDeviceProfile() = default;
37 
38     std::string GetDeviceId() const;
39     void SetDeviceId(const std::string& deviceId);
40     int32_t GetDeviceIdType() const;
41     void SetDeviceIdType(int32_t deviceType);
42     std::string GetDeviceIdHash() const;
43     void SetDeviceIdHash(const std::string& deviceIdHash);
44     int32_t GetStatus() const;
45     void SetStatus(int32_t status);
46     uint32_t GetBindType() const;
47     void SetBindType(uint32_t bindType);
48     int32_t GetPeerUserId() const;
49     void SetPeerUserId(int32_t peerUserId);
50     int32_t GetLocalUserId() const;
51     void SetLocalUserId(int32_t localUserId);
52     bool Marshalling(MessageParcel& parcel) const override;
53     bool UnMarshalling(MessageParcel& parcel) override;
54     std::string dump() const override;
55 
56 private:
57     std::string deviceId_;
58     uint32_t deviceIdType_;
59     std::string deviceIdHash_;
60     int32_t status_;
61     uint32_t bindType_;
62     int32_t peerUserId_;
63     int32_t localUserId_;
64 };
65 } // namespace DistributedDeviceProfile
66 } // namespace OHOS
67 #endif // OHOS_DP_TRUST_DEVICE_PROFILE_H
68