File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed
Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 11# libUartCommProtocolV2
2- support all platform
2+ ```
3+ 1、模块的用途:串口应用层协议栈,实现类TCP协议可靠传输:保证CommProtocolPacketAssembleAndSend发送的数据【必达、有序、不重复】,也支持类似UDP传输
4+ 2、平台适用性:该模块适用于一切平台,本身不依赖任何和系统相关的头文件及系统函数
5+ 3、可移植性: 通过CommProtocolRegisterHooks注册,实现向各平台porting
6+ 4、调用流程:
7+ 4.1、通过CommProtocolRegisterHooks注册协议栈需要的功能函数,主要包含三类:动态内存分配相关函数 (必备)
8+ 信号量相关函数 (非必备,建议注册,可提升性能)
9+ 睡眠函数 (必备)
10+ 4.2、通过CommProtocolInit初始化协议栈
11+ 4.3、通过CommProtocolReceiveUartData接收串口收到的数据,进行协议栈解析
12+ 4.4、通过CommProtocolPacketAssembleAndSend发送数据
13+ 4.5、通过CommProtocolFinal注销模块,该接口理论上不应该调到
14+ ```
Original file line number Diff line number Diff line change 2828extern "C" {
2929#endif
3030
31- /**
32- * 1、模块的用途:串口应用层协议栈,实现类TCP协议可靠传输:保证CommProtocolPacketAssembleAndSend发送的数据【必达、有序、不重复】,也支持类似UDP传输
33- * 2、平台适用性:该模块适用于一切平台,本身不依赖任何和系统相关的头文件及系统函数
34- * 3、可移植性: 通过CommProtocolRegisterHooks注册,实现向各平台porting
35- * 4、调用流程:
36- * 4.1、通过CommProtocolRegisterHooks注册协议栈需要的功能函数,主要包含三类:动态内存分配相关函数 (必备)
37- * 信号量相关函数 (非必备,建议注册,可提升性能)
38- * 睡眠函数 (必备)
39- * 4.2、通过CommProtocolInit初始化协议栈
40- * 4.3、通过CommProtocolReceiveUartData接收串口收到的数据,进行协议栈解析
41- * 4.4、通过CommProtocolPacketAssembleAndSend发送数据
42- * 4.5、通过CommProtocolFinal注销模块,该接口理论上不应该调到
43- */
44-
4531#define PACKED __attribute__ ((packed))
4632
4733typedef unsigned short CommCmd ;
You can’t perform that action at this time.
0 commit comments