refactor: 分文件重构,新建protocols文件夹,三个协议分文件存放:modbustcpslave/finsudpmaster/slmptcpmaster,结构更清晰

This commit is contained in:
claw committed 2026-04-02 22:35:56 +08:00
1 parent 99fa72eaa0
commit e3519bf1f4
8 files changed
+852 -741

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#ifndef SLMPTCPMASTER_H
#define SLMPTCPMASTER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
extern uint8_t slmp_txbuf[1024];
extern uint8_t slmp_rxbuf[1024];
extern uint16_t slmp_idx;
extern uint16_t slmp_addr;
extern uint16_t slmp_size;
extern uint16_t slmpTimegap;
extern uint16_t comm_count;
// 处理接收到的SLMP响应
_Bool slmp_handle_recv(uint16_t size);
// 构建SLMP请求,返回发送长度
uint16_t slmp_build_send(void);
// 超时计数,由主循环调用
void update_timeout_slmp(void);
// SLMP TCP客户端主函数
int32_t loopback_tcpc_slmp(uint8_t sn, uint8_t *destip, uint16_t destport);
#ifdef __cplusplus
}
#endif
#endif