API参考
载入中...
搜索中...
未找到
ui_type.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15#ifndef UI_TYPE_H
16#define UI_TYPE_H
17
18#include "hitls_build.h"
19#ifdef HITLS_BSL_UI
20
21#include <stdint.h>
22#include "bsl_sal.h"
23#include "bsl_ui.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif /* __cpluscplus */
28
29struct UI_ControlMethod {
30 int32_t (*uiOpen) (BSL_UI *ui); // Open the input and output streams
31 int32_t (*uiWrite) (BSL_UI *ui, BSL_UI_DataPack *data); // Write callback
32 int32_t (*uiRead) (BSL_UI *ui, BSL_UI_DataPack *data); // Read callback
33 int32_t (*uiClose) (BSL_UI *ui); // Close the input and output streams.
34};
35
36
37struct UI_Control {
38 const BSL_UI_Method *method;
40 void *in;
41 void *out;
42 void *exData;
43};
44
45struct UI_ControlDataPack {
46 uint32_t type;
47 uint32_t flags;
48 char *data;
49 uint32_t dataLen;
50 char *verifyData;
51};
52
53#define BSL_UI_SUPPORT_ABILITY(cap, pos) (((cap) & (pos)) != 0)
54
55#define BSL_UI_READ_BUFF_MAX_LEN 1025 // 1024 + '\0'
56
57#ifdef __cplusplus
58}
59#endif /* __cpluscplus */
60
61#endif /* HITLS_BSL_UI */
62
63#endif /* UI_TYPE_H */
void * BSL_SAL_ThreadLockHandle
定义 bsl_sal.h:63