Skip to content

Commit 8966f93

Browse files
committed
2 parents db59ec5 + 95480b8 commit 8966f93

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
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+
```

protocol/uni_communication.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@
2828
extern "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

4733
typedef unsigned short CommCmd;

0 commit comments

Comments
 (0)