39 lines
765 B
C
39 lines
765 B
C
/**
|
|
* @file modbustcpslave.h
|
|
* @brief Modbus TCP从站服务头文件
|
|
*/
|
|
#ifndef MODBUSTCPSLAVE_H
|
|
#define MODBUSTCPSLAVE_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifndef DATA_BUF_SIZE
|
|
#define DATA_BUF_SIZE 2048
|
|
#endif
|
|
|
|
|
|
|
|
// ============================================================================
|
|
// 接口函数
|
|
// ============================================================================
|
|
|
|
/**
|
|
* @brief Modbus TCP服务主函数,W5500socket主循环处理
|
|
* @param sn: socket编号
|
|
* @param port: 监听端口 (通常502)
|
|
* @return 0/正表示正常,负表示错误
|
|
*/
|
|
int32_t loopback_tcps_modbus(uint8_t sn, uint16_t port);
|
|
void update_modbusTCP_timeout();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|