Modbus: Change to more header files to make them a little more consistent with Nuttx coding stanards. Still not very close

This commit is contained in:
Gregory Nutt
2015-04-07 15:01:39 -06:00
parent af7f087ccf
commit b1151ef033
6 changed files with 76 additions and 53 deletions

View File

@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* apps/include/modbus/mbproto.h * apps/include/modbus/mbproto.h
* *
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at> * Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved. * All rights reserved.
* *

View File

@@ -1,5 +1,7 @@
/* /****************************************************************************
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * apps/modbus/ascii/mbascii.h
*
* FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at> * Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved. * All rights reserved.
* *
@@ -25,22 +27,24 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* File: $Id: mbascii.h,v 1.8 2006/12/07 22:10:34 wolti Exp $ ****************************************************************************/
*/
#ifndef _MB_ASCII_H #ifndef __APPS_MODBUS_ASCII_MBASCII_H
#define _MB_ASCII_H #define __APPS_MODBUS_ASCII_MBASCII_H
#ifdef __cplusplus #ifdef __cplusplus
PR_BEGIN_EXTERN_C PR_BEGIN_EXTERN_C
#endif #endif
/****************************************************************************
* Global Function Prototypes
****************************************************************************/
#ifdef CONFIG_MB_ASCII_ENABLED #ifdef CONFIG_MB_ASCII_ENABLED
eMBErrorCode eMBASCIIInit(uint8_t slaveAddress, uint8_t ucPort, eMBErrorCode eMBASCIIInit(uint8_t slaveAddress, uint8_t ucPort,
speed_t ulBaudRate, eMBParity eParity); speed_t ulBaudRate, eMBParity eParity);
void eMBASCIIStart(void); void eMBASCIIStart(void);
void eMBASCIIStop(void); void eMBASCIIStop(void);
eMBErrorCode eMBASCIIReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame, eMBErrorCode eMBASCIIReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
uint16_t * pusLength); uint16_t * pusLength);
eMBErrorCode eMBASCIISend(uint8_t slaveAddress, const uint8_t *pucFrame, eMBErrorCode eMBASCIISend(uint8_t slaveAddress, const uint8_t *pucFrame,
@@ -53,4 +57,5 @@ bool xMBASCIITimerT1SExpired( void );
#ifdef __cplusplus #ifdef __cplusplus
PR_END_EXTERN_C PR_END_EXTERN_C
#endif #endif
#endif
#endif /* __APPS_MODBUS_ASCII_MBASCII_H */

View File

@@ -1,6 +1,7 @@
/**************************************************************************** /****************************************************************************
* apps/modbus/nuttx/port.h
* *
* FreeModbus Libary: NuttX Port * FreeModbus Library: NuttX Port
* Based on the FreeModbus Linux port by: * Based on the FreeModbus Linux port by:
* *
* Copyright (C) 2006 Christian Walter <wolti@sil.at> * Copyright (C) 2006 Christian Walter <wolti@sil.at>

View File

@@ -1,5 +1,7 @@
/* /****************************************************************************
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * apps/modutils/rtu/mbcrc.h
*
* FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at> * Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved. * All rights reserved.
* *
@@ -25,12 +27,15 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* File: $Id: mbcrc.h,v 1.5 2006/12/07 22:10:34 wolti Exp $ ****************************************************************************/
*/
#ifndef _MB_CRC_H #ifndef __APPS_MODBUS_RTU_MBCRC_H
#define _MB_CRC_H #define __APPS_MODBUS_RTU_MBCRC_H
/****************************************************************************
* Global Function Prototypes
****************************************************************************/
uint16_t usMBCRC16(uint8_t *pucFrame, uint16_t usLen); uint16_t usMBCRC16(uint8_t *pucFrame, uint16_t usLen);
#endif #endif /* __APPS_MODBUS_RTU_MBCRC_H */

View File

@@ -1,5 +1,7 @@
/* /****************************************************************************
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * apps/modbus/rtu/mbrtu.h
*
* FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at> * Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved. * All rights reserved.
* *
@@ -25,21 +27,27 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* File: $Id: mbrtu.h,v 1.9 2006/12/07 22:10:34 wolti Exp $ ****************************************************************************/
*/
#ifndef _MB_RTU_H #ifndef __APPS_MODBUS_RTU_MBRTU_H
#define _MB_RTU_H #define __APPS_MODBUS_RTU_MBRTU_H
#ifdef __cplusplus #ifdef __cplusplus
PR_BEGIN_EXTERN_C PR_BEGIN_EXTERN_C
#endif #endif
eMBErrorCode eMBRTUInit( uint8_t slaveAddress, uint8_t ucPort, speed_t ulBaudRate,
eMBParity eParity ); /****************************************************************************
* Global Function Prototypes
****************************************************************************/
eMBErrorCode eMBRTUInit(uint8_t slaveAddress, uint8_t ucPort,
speed_t ulBaudRate, eMBParity eParity);
void eMBRTUStart(void); void eMBRTUStart(void);
void eMBRTUStop(void); void eMBRTUStop(void);
eMBErrorCode eMBRTUReceive( uint8_t * pucRcvAddress, uint8_t ** pucFrame, uint16_t * pusLength ); eMBErrorCode eMBRTUReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
eMBErrorCode eMBRTUSend( uint8_t slaveAddress, const uint8_t * pucFrame, uint16_t usLength ); uint16_t *pusLength);
eMBErrorCode eMBRTUSend(uint8_t slaveAddress, const uint8_t *pucFrame,
uint16_t usLength);
bool xMBRTUReceiveFSM(void); bool xMBRTUReceiveFSM(void);
bool xMBRTUTransmitFSM(void); bool xMBRTUTransmitFSM(void);
bool xMBRTUTimerT15Expired(void); bool xMBRTUTimerT15Expired(void);
@@ -48,4 +56,5 @@ bool xMBRTUTimerT35Expired( void );
#ifdef __cplusplus #ifdef __cplusplus
PR_END_EXTERN_C PR_END_EXTERN_C
#endif #endif
#endif
#endif /* __APPS_MODBUS_RTU_MBRTU_H */

View File

@@ -1,4 +1,6 @@
/* /****************************************************************************
* apps/modbus/tcp/mbtcp.h
*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at> * Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved. * All rights reserved.
@@ -30,14 +32,14 @@
#ifndef __APPS_MODBUS_TCP_MBTCP_H #ifndef __APPS_MODBUS_TCP_MBTCP_H
#define __APPS_MODBUS_TCP_MBTCP_H #define __APPS_MODBUS_TCP_MBTCP_H
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
PR_BEGIN_EXTERN_C PR_BEGIN_EXTERN_C
#endif #endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define MB_TCP_PSEUDO_ADDRESS 255 #define MB_TCP_PSEUDO_ADDRESS 255
/**************************************************************************** /****************************************************************************
@@ -55,4 +57,5 @@ eMBErrorCode eMBTCPSend(uint8_t _unused, const uint8_t *pucFrame,
#ifdef __cplusplus #ifdef __cplusplus
PR_END_EXTERN_C PR_END_EXTERN_C
#endif #endif
#endif /* __APPS_MODBUS_TCP_MBTCP_H */ #endif /* __APPS_MODBUS_TCP_MBTCP_H */