1 /*
2  * Copyright (c) 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_ACCESS_TOKEN_DEVICE_INFO_H
17 #define OHOS_ACCESS_TOKEN_DEVICE_INFO_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 namespace OHOS {
23 namespace Security {
24 namespace AccessToken {
25 namespace DistributedHardware {
26 static constexpr int32_t DM_MAX_DEVICE_ID_LEN = 96;
27 static constexpr int32_t DM_MAX_DEVICE_NAME_LEN = 128;
28 
29 typedef struct DmDeviceInfo {
30     /**
31      * Device Id of the device.
32      */
33     char deviceId[DM_MAX_DEVICE_ID_LEN];
34     /**
35      * Device name of the device.
36      */
37     char deviceName[DM_MAX_DEVICE_NAME_LEN];
38     /**
39      * Device type of the device.
40      */
41     uint16_t deviceTypeId;
42     /**
43      * NetworkId of the device.
44      */
45     char networkId[DM_MAX_DEVICE_ID_LEN];
46     /**
47      * The distance of discovered device, in centimeter(cm).
48      */
49     int32_t range;
50     /**
51      * NetworkType of the device.
52      */
53     int32_t networkType;
54     /**
55      * Extra data of the device.
56      * include json keys: "CONN_ADDR_TYPE", "BR_MAC_", "BLE_MAC", "WIFI_IP", "WIFI_PORT", "CUSTOM_DATA"
57      */
58     std::string extraData;
59 } DmDeviceInfo;
60 } // namespace DistributedHardware
61 } // namespace AccessToken
62 } // namespace Security
63 } // namespace OHOS
64 #endif // OHOS_ACCESS_TOKEN_DEVICE_INFO_H
65