- 添加CDC_PROTO_TYPE_LED_STATE、CDC_PROTO_TYPE_TIME_SYNC和 CDC_PROTO_TYPE_THEME_RGB协议类型定义 - 在protobuf中定义LedState、TimeSync和ThemeRgb消息结构 - 更新CdcPacketBody消息以包含新的协议类型 - 增加协议能力标志位以支持新功能
34 lines
838 B
C
34 lines
838 B
C
#ifndef BLINKY_PROTOCOL_MODULE_H_
|
|
#define BLINKY_PROTOCOL_MODULE_H_
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define CDC_PROTO_TYPE_HELLO_REQ 0x01U
|
|
#define CDC_PROTO_TYPE_HELLO_RSP 0x02U
|
|
#define CDC_PROTO_TYPE_BITMAP 0x10U
|
|
#define CDC_PROTO_TYPE_FUNCTION_KEY_EVENT 0x20U
|
|
#define CDC_PROTO_TYPE_LED_STATE 0x21U
|
|
#define CDC_PROTO_TYPE_TIME_SYNC 0x30U
|
|
#define CDC_PROTO_TYPE_THEME_RGB 0x31U
|
|
#define CDC_PROTO_TYPE_ACK 0x7EU
|
|
#define CDC_PROTO_TYPE_ERROR 0x7FU
|
|
|
|
int protocol_module_process_cdc_packet(uint8_t req_type,
|
|
const uint8_t *req_payload,
|
|
size_t req_payload_len,
|
|
uint8_t *rsp_type,
|
|
uint8_t *rsp_payload,
|
|
size_t rsp_payload_buf_size,
|
|
size_t *rsp_payload_len);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* BLINKY_PROTOCOL_MODULE_H_ */
|