• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 DEVICE_SECURITY_INFO_H
17 #define DEVICE_SECURITY_INFO_H
18 
19 #include <stdint.h>
20 
21 #include "device_security_defines.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 typedef struct DeviceSecurityInfo DeviceSecurityInfo;
28 
29 /**
30  * 设备安全等级等级信息的回调
31  */
32 typedef void DeviceSecurityInfoCallback(const DeviceIdentify *identify, struct DeviceSecurityInfo *info);
33 
34 /**
35  * 同步请求获取本机/邻居设备的设备安全
36  *
37  * @param [in]identify 设备标识符
38  * @param [in]option option值
39  * @param [out]info, 需要调用者释放
40  * @return
41  */
42 int32_t RequestDeviceSecurityInfo(const DeviceIdentify *identify, const RequestOption *option,
43     DeviceSecurityInfo **info);
44 
45 /**
46  * 异步请求获取本机/邻居设备的设备安全
47  *
48  * @param [in]identify 设备标识符
49  * @param [in]option option值
50  * @param [in]callback
51  * @return
52  */
53 int32_t RequestDeviceSecurityInfoAsync(const DeviceIdentify *identify, const RequestOption *option,
54     DeviceSecurityInfoCallback callback);
55 
56 /**
57  * 释放设备安全等级信息
58  * @param info RequestDeviceSecLevelInfo函数返回的设备安全等级信息
59  */
60 void FreeDeviceSecurityInfo(DeviceSecurityInfo *info);
61 
62 /**
63  * 提取DeviceSecLevelInfo中的设备安全等级
64  * @param info [in]设备安全等级信息
65  * @param level [out]设备安全等级。
66  * @return
67  */
68 int32_t GetDeviceSecurityLevelValue(const DeviceSecurityInfo *info, int32_t *level);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif // DEVICE_SECURITY_INFO_H
75