This commit is contained in:
claw committed 2026-03-31 13:27:23 +08:00
commit 53c85e94af
393 files changed
+141844

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
#ifndef _LOOPBACK_H_
#define _LOOPBACK_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "w5500/modbusRtuMaster.h"
/* Loopback test debug message printout enable */
//#define _LOOPBACK_DEBUG_
//#define _LOOPBACK_DEBUG_S7_
//#define _LOOPBACK_DEBUG_SLMP_
/* DATA_BUF_SIZE define for Loopback example */
#ifndef DATA_BUF_SIZE
#define DATA_BUF_SIZE 2048
#endif
/************************/
/* Select LOOPBACK_MODE */
/************************/
#define LOOPBACK_MAIN_NOBLOCK 0
#define LOOPBACK_MODE LOOPBACK_MAIN_NOBLOCK
extern rtumST readST[10];
extern rtumST writeST[10];
extern uint16_t client_wait_timeout;
extern uint16_t slmpTimeout;
extern uint16_t slmpTimegap;
/* TCP server Loopback test example */
int32_t loopback_tcps_modbus(uint8_t sn, uint8_t* buf, uint16_t port, uint16_t *comm_cnt, _Bool *comm);
/* TCP client Loopback test example */
int32_t loopback_tcpc_s7(uint8_t sn,uint8_t *recvbuf, uint8_t *destip, uint16_t destport);
int32_t loopback_tcpc_slmp(uint8_t sn, uint8_t *destip, uint16_t destport, uint16_t *comm_cnt, _Bool *comm);
/* UDP Loopback test example */
int32_t loopback_udps(uint8_t sn, uint8_t* buf, uint16_t port);
#ifdef __cplusplus
}
#endif
#endif