- 将ble_serial_module替换为ble_nus_module以使用标准的BLE NUS服务 - 移除不再使用的cdc_wrapper_module和相关事件处理 - 更新协议传输层抽象,支持USB CDC和BLE NUS两种传输方式 - 创建统一的proto_rx_event和proto_tx_event替代专用的串行通信事件 - 添加proto_common.h定义传输类型枚举 - 修改protocol_module接口以支持多传输方式 - 在prj.conf中启用CONFIG_BT_ZEPHYR_NUS配置选项
28 lines
581 B
C
28 lines
581 B
C
#ifndef BLINKY_PROTOCOL_MODULE_H_
|
|
#define BLINKY_PROTOCOL_MODULE_H_
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "proto_common.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
int protocol_module_process_message(enum proto_transport transport,
|
|
const uint8_t *req_payload,
|
|
size_t req_payload_len,
|
|
uint8_t *rsp_payload,
|
|
size_t rsp_payload_buf_size,
|
|
size_t *rsp_payload_len);
|
|
|
|
void protocol_module_reset_transport_state(enum proto_transport transport);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* BLINKY_PROTOCOL_MODULE_H_ */
|