• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) Huawei Device Co., Ltd. 2025-2025. All rights reserved.
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 #ifndef TRUST_PAIR_DEVICE_H
16 #define TRUST_PAIR_DEVICE_H
17 
18 #include <cstddef>
19 #include <cstdint>
20 #include <string>
21 #include <vector>
22 #include "iosfwd"
23 #include "bt_uuid.h"
24 
25 namespace OHOS {
26 namespace bluetooth {
27 class TrustPairDevice {
28 public:
29     TrustPairDevice() = default;
30     ~TrustPairDevice() = default;
31 
32     void SetMacAddress(const std::string &mac);
33     std::string GetMacAddress() const;
34 
35     void SetBluetoothClass(int32_t bluetoothClass);
36     int32_t GetBluetoothClass() const;
37 
38     void SetDeviceName(const std::string &deviceName);
39     std::string GetDeviceName() const;
40 
41     void SetToken(const std::vector<uint8_t> &token);
42     std::vector<uint8_t> GetToken();
43 
44     void SetUuid(const std::vector<std::string> &uuids);
45     std::vector<std::string> GetUuid() const;
46     std::vector<bluetooth::Uuid> GetParseUuid();
47 
48     void SetSecureAdvertisingInfo(const std::vector<uint8_t> &randomDeviceInfo);
49     std::vector<uint8_t> GetSecureAdvertisingInfo();
50 protected:
51     std::string sn_{""};
52     std::string deviceType_{""};
53     std::string modelId_{""};
54     std::string manufactory_{""};
55     std::string productId_{""};
56     std::string hiLinkVersion_{""};
57     std::string macAddress_{""};
58     std::string serviceType_{""};
59     std::string serviceId_{""};
60     std::string deviceName_{""};
61     std::vector<std::string> uuids_{};
62     int32_t bluetoothClass_{0};
63     std::vector<uint8_t> token_;
64     int64_t deviceNameTime_{0};
65     std::vector<uint8_t> secureAdvertisingInfo_;
66     int32_t pairState_{0};
67 };
68 }
69 }
70 
71 #endif //BT_SENSING_INFO_H