Modified version of ModbusTCP
Dependencies: EthernetNetIf mbed
ModBus/mbtcp.h@0:62be54b8975d, 2012-03-13 (annotated)
- Committer:
- paleskyjp
- Date:
- Tue Mar 13 09:11:49 2012 +0000
- Revision:
- 0:62be54b8975d
The first modification of ModbusTCP
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
paleskyjp | 0:62be54b8975d | 1 | /* |
paleskyjp | 0:62be54b8975d | 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. |
paleskyjp | 0:62be54b8975d | 3 | * Copyright (c) 2006 Christian Walter <wolti@sil.at> |
paleskyjp | 0:62be54b8975d | 4 | * All rights reserved. |
paleskyjp | 0:62be54b8975d | 5 | * |
paleskyjp | 0:62be54b8975d | 6 | * Redistribution and use in source and binary forms, with or without |
paleskyjp | 0:62be54b8975d | 7 | * modification, are permitted provided that the following conditions |
paleskyjp | 0:62be54b8975d | 8 | * are met: |
paleskyjp | 0:62be54b8975d | 9 | * 1. Redistributions of source code must retain the above copyright |
paleskyjp | 0:62be54b8975d | 10 | * notice, this list of conditions and the following disclaimer. |
paleskyjp | 0:62be54b8975d | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
paleskyjp | 0:62be54b8975d | 12 | * notice, this list of conditions and the following disclaimer in the |
paleskyjp | 0:62be54b8975d | 13 | * documentation and/or other materials provided with the distribution. |
paleskyjp | 0:62be54b8975d | 14 | * 3. The name of the author may not be used to endorse or promote products |
paleskyjp | 0:62be54b8975d | 15 | * derived from this software without specific prior written permission. |
paleskyjp | 0:62be54b8975d | 16 | * |
paleskyjp | 0:62be54b8975d | 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
paleskyjp | 0:62be54b8975d | 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
paleskyjp | 0:62be54b8975d | 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
paleskyjp | 0:62be54b8975d | 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
paleskyjp | 0:62be54b8975d | 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
paleskyjp | 0:62be54b8975d | 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
paleskyjp | 0:62be54b8975d | 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
paleskyjp | 0:62be54b8975d | 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
paleskyjp | 0:62be54b8975d | 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
paleskyjp | 0:62be54b8975d | 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
paleskyjp | 0:62be54b8975d | 27 | * |
paleskyjp | 0:62be54b8975d | 28 | * File: $Id: mbtcp.h,v 1.2 2006/12/07 22:10:34 wolti Exp $ |
paleskyjp | 0:62be54b8975d | 29 | */ |
paleskyjp | 0:62be54b8975d | 30 | |
paleskyjp | 0:62be54b8975d | 31 | #ifndef _MB_TCP_H |
paleskyjp | 0:62be54b8975d | 32 | #define _MB_TCP_H |
paleskyjp | 0:62be54b8975d | 33 | |
paleskyjp | 0:62be54b8975d | 34 | #ifdef __cplusplus |
paleskyjp | 0:62be54b8975d | 35 | PR_BEGIN_EXTERN_C |
paleskyjp | 0:62be54b8975d | 36 | #endif |
paleskyjp | 0:62be54b8975d | 37 | |
paleskyjp | 0:62be54b8975d | 38 | /* ----------------------- Defines ------------------------------------------*/ |
paleskyjp | 0:62be54b8975d | 39 | #define MB_TCP_PSEUDO_ADDRESS 255 |
paleskyjp | 0:62be54b8975d | 40 | |
paleskyjp | 0:62be54b8975d | 41 | /* ----------------------- Function prototypes ------------------------------*/ |
paleskyjp | 0:62be54b8975d | 42 | eMBErrorCode eMBTCPDoInit( USHORT ucTCPPort ); |
paleskyjp | 0:62be54b8975d | 43 | void eMBTCPStart( void ); |
paleskyjp | 0:62be54b8975d | 44 | void eMBTCPStop( void ); |
paleskyjp | 0:62be54b8975d | 45 | eMBErrorCode eMBTCPReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, |
paleskyjp | 0:62be54b8975d | 46 | USHORT * pusLength ); |
paleskyjp | 0:62be54b8975d | 47 | eMBErrorCode eMBTCPSend( UCHAR _unused, const UCHAR * pucFrame, |
paleskyjp | 0:62be54b8975d | 48 | USHORT usLength ); |
paleskyjp | 0:62be54b8975d | 49 | |
paleskyjp | 0:62be54b8975d | 50 | #ifdef __cplusplus |
paleskyjp | 0:62be54b8975d | 51 | PR_END_EXTERN_C |
paleskyjp | 0:62be54b8975d | 52 | #endif |
paleskyjp | 0:62be54b8975d | 53 | #endif |