From cc432b761c884a0bd8e9d83db0a4e26109fc08b1 Mon Sep 17 00:00:00 2001
From: chen <15335560115@163.com>
Date: 星期五, 08 十一月 2024 15:35:38 +0800
Subject: [PATCH] 安邦手环GPS删除部分无用数据和修改4G波特率9600出厂测试固件

---
 keil/include/components/se/inc/se_api.h |   83 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/keil/include/components/se/inc/se_api.h b/keil/include/components/se/inc/se_api.h
new file mode 100644
index 0000000..586c5e7
--- /dev/null
+++ b/keil/include/components/se/inc/se_api.h
@@ -0,0 +1,83 @@
+#ifndef _7816_3_T1_SEAPI_H_
+#define _7816_3_T1_SEAPI_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "T1.h"
+
+typedef enum
+{
+    // All wired transaction
+    ESE_MODE_NORMAL = 0,
+    // nfcc FW/BL download used
+    ESE_MODE_NFCC_DL,
+    // eSE COS download used
+    ESE_MODE_ESE_DL,
+} SE_init_mode;
+
+typedef struct
+{
+    ESESTATUS ESE_lib_status;
+
+    bool is_read_done;
+    uint32_t max_write_retry_cnt;
+    uint32_t write_retry_time;
+    uint32_t max_read_retry_cnt;
+    uint32_t read_retry_time;
+
+    uint32_t max_recovery_cnt;
+
+    uint8_t max_blk_retry_cnt;
+
+    uint16_t max_wtx_cnt;
+
+    bool is_resync_recovery_flag;
+
+    uint16_t max_IFSD;
+
+    uint16_t max_IFSC;
+
+    bool is_T1_ext_hdr_len;
+    uint8_t seq_num_device;
+    uint8_t seq_num_card;
+    bool is_seq_num_dr;
+    T1_transmit_receive_state next_T1_state;
+
+    /** T1 **/
+    T1_params *p_T1_params;
+} SE_context;
+
+ESESTATUS se_open(SE_init_mode init_mode);
+ESESTATUS se_init(SE_init_mode init_mode);
+
+ESESTATUS se_transmit_receive(SE_data *p_cmd, SE_data *p_resp);
+
+ESESTATUS se_deinit(void);
+ESESTATUS se_status(void);
+ESESTATUS se_close(void);
+
+extern SE_context g_ese_ctx;
+
+/*******************************************************************************
+ * @Function         tm_main
+ * @Parameters       None.
+ * @Returns          0 - fail;  other never return.
+ ******************************************************************************/
+int tm_main(void);
+
+uint16_t passthrough_apdu_to_t1(uint8_t *cmd_buf, uint16_t cmd_len, uint32_t *resp_buf_addr, uint16_t *resp_len);
+uint16_t transmit_only_apdu_to_t1(uint8_t *cmd_buf, uint16_t cmd_len);
+uint16_t receive_only_resp_from_t1(uint32_t *resp_buf_addr, uint16_t *resp_len);
+ESESTATUS se_transmit_only(SE_data *p_cmd);
+ESESTATUS se_receive_only(SE_data *p_resp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _STESEAPI_H_ */

--
Gitblit v1.9.3