|
T-Box Basic dev
|
ICC 核间通信协议引擎定义,包含状态机、帧解析、ACK 重传及心跳管理等数据结构与接口 More...
Go to the source code of this file.
Data Structures | |
| struct | icc_proto_stats_t |
| struct | icc_ack_entry_t |
| struct | icc_parser_ctx_t |
| struct | icc_proto_mgr_t |
Functions | |
| icc_proto_err_t | icc_proto_init (icc_proto_mgr_t *mgr) |
| 初始化 ICC 协议管理器。 | |
| void | icc_proto_deinit (icc_proto_mgr_t *mgr) |
| 反初始化 ICC 协议管理器。 | |
| void | icc_proto_start (icc_proto_mgr_t *mgr) |
| 启动 ICC 协议栈并进入握手状态。 | |
| void | icc_proto_stop (icc_proto_mgr_t *mgr) |
| 停止 ICC 协议栈。 | |
| icc_proto_err_t | icc_proto_send (icc_proto_mgr_t *mgr, uint16_t cmd, uint8_t need_ack, const uint8_t *data, uint16_t len) |
| 发送一条 ICC 协议消息。 | |
| icc_proto_err_t | icc_proto_send_space_enough (icc_proto_mgr_t *mgr, uint8_t need_ack, uint16_t len) |
| 检查 ICC 协议发送空间是否充足。 | |
| void | icc_proto_feed (icc_proto_mgr_t *mgr, const uint8_t *buf, uint16_t len) |
| 向 ICC 协议栈输入接收字节流。 | |
| void | icc_proto_tick (icc_proto_mgr_t *mgr) |
| 驱动 ICC 协议栈周期处理。 | |
| void | icc_proto_set_send_func (icc_proto_mgr_t *mgr, icc_proto_send_func_t func) |
| 设置 ICC 协议底层发送函数。 | |
| void | icc_proto_on_message (icc_proto_mgr_t *mgr, icc_proto_msg_cb_t cb) |
| 设置 ICC 协议消息接收回调。 | |
| void | icc_proto_on_event (icc_proto_mgr_t *mgr, icc_proto_evt_cb_t cb) |
| 设置 ICC 协议事件回调。 | |
| void | icc_proto_set_user_data (icc_proto_mgr_t *mgr, void *user_data) |
| 设置 ICC 协议用户数据。 | |
| icc_proto_state_t | icc_proto_get_state (icc_proto_mgr_t *mgr) |
| 获取 ICC 协议状态。 | |
| void | icc_proto_get_stats (icc_proto_mgr_t *mgr, icc_proto_stats_t *stats) |
| 获取 ICC 协议统计信息。 | |
| void | icc_proto_reset_stats (icc_proto_mgr_t *mgr) |
| 清空 ICC 协议统计信息。 | |
ICC 核间通信协议引擎定义,包含状态机、帧解析、ACK 重传及心跳管理等数据结构与接口
| void icc_proto_deinit | ( | icc_proto_mgr_t * | mgr | ) |
反初始化 ICC 协议管理器。
| mgr | ICC 协议管理器。 |
| void icc_proto_feed | ( | icc_proto_mgr_t * | mgr, |
| const uint8_t * | buf, | ||
| uint16_t | len ) |
向 ICC 协议栈输入接收字节流。
| mgr | ICC 协议管理器。 |
| buf | 接收字节流。 |
| len | 接收字节流长度。 |
| icc_proto_state_t icc_proto_get_state | ( | icc_proto_mgr_t * | mgr | ) |
获取 ICC 协议状态。
| mgr | ICC 协议管理器。 |
| void icc_proto_get_stats | ( | icc_proto_mgr_t * | mgr, |
| icc_proto_stats_t * | stats ) |
获取 ICC 协议统计信息。
| mgr | ICC 协议管理器。 |
| stats | 统计信息输出缓冲区。 |
| icc_proto_err_t icc_proto_init | ( | icc_proto_mgr_t * | mgr | ) |
初始化 ICC 协议管理器。
| mgr | ICC 协议管理器。 |
| void icc_proto_on_event | ( | icc_proto_mgr_t * | mgr, |
| icc_proto_evt_cb_t | cb ) |
设置 ICC 协议事件回调。
| mgr | ICC 协议管理器。 |
| cb | 事件回调。 |
| void icc_proto_on_message | ( | icc_proto_mgr_t * | mgr, |
| icc_proto_msg_cb_t | cb ) |
设置 ICC 协议消息接收回调。
| mgr | ICC 协议管理器。 |
| cb | 消息接收回调。 |
| void icc_proto_reset_stats | ( | icc_proto_mgr_t * | mgr | ) |
清空 ICC 协议统计信息。
| mgr | ICC 协议管理器。 |
| icc_proto_err_t icc_proto_send | ( | icc_proto_mgr_t * | mgr, |
| uint16_t | cmd, | ||
| uint8_t | need_ack, | ||
| const uint8_t * | data, | ||
| uint16_t | len ) |
发送一条 ICC 协议消息。
| mgr | ICC 协议管理器。 |
| cmd | ICC 命令字。 |
| need_ack | 是否需要 ACK。 |
| data | 待发送消息数据,可为空。 |
| len | 待发送消息长度。 |
| icc_proto_err_t icc_proto_send_space_enough | ( | icc_proto_mgr_t * | mgr, |
| uint8_t | need_ack, | ||
| uint16_t | len ) |
检查 ICC 协议发送空间是否充足。
| mgr | ICC 协议管理器。 |
| need_ack | 是否需要 ACK。 |
| len | 待发送消息长度。 |
| void icc_proto_set_send_func | ( | icc_proto_mgr_t * | mgr, |
| icc_proto_send_func_t | func ) |
设置 ICC 协议底层发送函数。
| mgr | ICC 协议管理器。 |
| func | 底层发送函数。 |
| void icc_proto_set_user_data | ( | icc_proto_mgr_t * | mgr, |
| void * | user_data ) |
设置 ICC 协议用户数据。
| mgr | ICC 协议管理器。 |
| user_data | 用户数据。 |
| void icc_proto_start | ( | icc_proto_mgr_t * | mgr | ) |
启动 ICC 协议栈并进入握手状态。
| mgr | ICC 协议管理器。 |
| void icc_proto_stop | ( | icc_proto_mgr_t * | mgr | ) |
停止 ICC 协议栈。
| mgr | ICC 协议管理器。 |
| void icc_proto_tick | ( | icc_proto_mgr_t * | mgr | ) |
驱动 ICC 协议栈周期处理。
| mgr | ICC 协议管理器。 |