From e61d1595ebb1fa76b499cddec2df4bd66ec92b97 Mon Sep 17 00:00:00 2001 From: jinlicong <493886250@qq.com> Date: Mon, 20 May 2024 20:02:47 +0800 Subject: [PATCH] 继续完善 --- Function/modbus/tcp/mbtcp.h | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Soft/mbcrc.h b/Function/modbus/tcp/mbtcp.h similarity index 69% copy from Soft/mbcrc.h copy to Function/modbus/tcp/mbtcp.h index a2674cb..16b651e 100644 --- a/Soft/mbcrc.h +++ b/Function/modbus/tcp/mbtcp.h @@ -27,11 +27,26 @@ * */ -#ifndef _MB_CRC_H -#define _MB_CRC_H +#ifndef _MB_TCP_H +#define _MB_TCP_H -#include "port.h" +#ifdef __cplusplus +PR_BEGIN_EXTERN_C +#endif -USHORT usMBCRC16(USHORT usInit, UCHAR * pucFrame, ULONG usLen ); +/* ----------------------- Defines ------------------------------------------*/ +#define MB_TCP_PSEUDO_ADDRESS 255 +/* ----------------------- Function prototypes ------------------------------*/ + eMBErrorCode eMBTCPDoInit( USHORT ucTCPPort ); +void eMBTCPStart( void ); +void eMBTCPStop( void ); +eMBErrorCode eMBTCPReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, + USHORT * pusLength ); +eMBErrorCode eMBTCPSend( UCHAR _unused, const UCHAR * pucFrame, + USHORT usLength ); + +#ifdef __cplusplus +PR_END_EXTERN_C +#endif #endif -- Gitblit v1.9.3