modbus_debug.h
Go to the documentation of this file.
1 /**
2  * @file modbus_debug.h
3  * @brief Data logging functions for debugging purpose (Modbus/TCP)
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _MODBUS_DEBUG_H
30 #define _MODBUS_DEBUG_H
31 
32 //Dependencies
33 #include "core/net.h"
34 #include "modbus/modbus_common.h"
35 
36 //C++ guard
37 #ifdef __cplusplus
38  extern "C" {
39 #endif
40 
41 //Modbus/TCP related functions
42 error_t modbusDumpRequestPdu(const void *pdu, size_t length);
43 error_t modbusDumpResponsePdu(const void *pdu, size_t length);
44 
46  size_t length);
47 
49  size_t length);
50 
52  size_t length);
53 
55  size_t length);
56 
58  size_t length);
59 
61  size_t length);
62 
64  size_t length);
65 
67  size_t length);
68 
70  size_t length);
71 
73  size_t length);
74 
76  size_t length);
77 
79  size_t length);
80 
82  size_t length);
83 
85  size_t length);
86 
88  size_t length);
89 
91  size_t length);
92 
94  size_t length);
95 
97  size_t length);
98 
100  size_t length);
101 
103  size_t length);
104 
106  size_t length);
107 
108 //C++ guard
109 #ifdef __cplusplus
110  }
111 #endif
112 
113 #endif
__start_packed struct @214 ModbusReadDiscreteInputsReq
Read Discrete Inputs request PDU.
Definitions common to Modbus/TCP client and server.
__start_packed struct @228 ModbusMaskWriteRegReq
Mask Write Register request PDU.
__start_packed struct @221 ModbusWriteSingleCoilResp
Write Single Coil response PDU.
error_t modbusDumpReadInputRegsReq(const ModbusReadInputRegsReq *request, size_t length)
Dump Read Input Registers request.
Definition: modbus_debug.c:451
error_t modbusDumpReadWriteMultipleRegsResp(const ModbusReadWriteMultipleRegsResp *response, size_t length)
Dump Read Write Multiple Registers response.
Definition: modbus_debug.c:772
__start_packed struct @219 ModbusReadInputRegsResp
Read Holding Input response PDU.
error_t modbusDumpReadWriteMultipleRegsReq(const ModbusReadWriteMultipleRegsReq *request, size_t length)
Dump Read Write Multiple Registers request.
Definition: modbus_debug.c:742
TCP/IP stack core.
__start_packed struct @218 ModbusReadInputRegsReq
Read Holding Input request PDU.
error_t modbusDumpReadCoilsResp(const ModbusReadCoilsResp *response, size_t length)
Dump Read Coils response.
Definition: modbus_debug.c:327
__start_packed struct @231 ModbusReadWriteMultipleRegsResp
Read/Write Multiple Registers response PDU.
error_t modbusDumpReadHoldingRegsReq(const ModbusReadHoldingRegsReq *request, size_t length)
Dump Read Holding Registers request.
Definition: modbus_debug.c:402
__start_packed struct @227 ModbusWriteMultipleRegsResp
Write Multiple Registers response PDU.
__start_packed struct @217 ModbusReadHoldingRegsResp
Read Holding Registers response PDU.
__start_packed struct @230 ModbusReadWriteMultipleRegsReq
Read/Write Multiple Registers request PDU.
error_t modbusDumpWriteSingleCoilResp(const ModbusWriteSingleCoilResp *response, size_t length)
Dump Write Single Coil response.
Definition: modbus_debug.c:523
error_t modbusDumpWriteSingleCoilReq(const ModbusWriteSingleCoilReq *request, size_t length)
Dump Write Single Coil request.
Definition: modbus_debug.c:500
error_t modbusDumpWriteMultipleCoilsReq(const ModbusWriteMultipleCoilsReq *request, size_t length)
Dump Write Multiple Coils request.
Definition: modbus_debug.c:592
error_t modbusDumpReadDiscreteInputsReq(const ModbusReadDiscreteInputsReq *request, size_t length)
Dump Read Discrete Inputs request.
Definition: modbus_debug.c:353
__start_packed struct @215 ModbusReadDiscreteInputsResp
Read Discrete Inputs response PDU.
__start_packed struct @220 ModbusWriteSingleCoilReq
Write Single Coil request PDU.
error_t modbusDumpExceptionResp(const ModbusExceptionResp *response, size_t length)
Dump Exception response.
Definition: modbus_debug.c:798
__start_packed struct @229 ModbusMaskWriteRegResp
Mask Write Register response PDU.
__start_packed struct @216 ModbusReadHoldingRegsReq
Read Holding Registers request PDU.
error_t modbusDumpWriteSingleRegResp(const ModbusWriteSingleRegResp *response, size_t length)
Dump Write Single Register response.
Definition: modbus_debug.c:569
error_t modbusDumpWriteMultipleRegsReq(const ModbusWriteMultipleRegsReq *request, size_t length)
Dump Write Multiple Registers request.
Definition: modbus_debug.c:643
__start_packed struct @232 ModbusExceptionResp
Exception response PDU.
__start_packed struct @223 ModbusWriteSingleRegResp
Write Single Register response PDU.
error_t modbusDumpResponsePdu(const void *pdu, size_t length)
Dump Modbus response PDU for debugging purpose.
Definition: modbus_debug.c:196
__start_packed struct @222 ModbusWriteSingleRegReq
Write Single Register request PDU.
error_t modbusDumpMaskWriteRegResp(const ModbusMaskWriteRegResp *response, size_t length)
Dump Mask Write Register response.
Definition: modbus_debug.c:718
error_t
Error codes.
Definition: error.h:40
error_t modbusDumpMaskWriteRegReq(const ModbusMaskWriteRegReq *request, size_t length)
Dump Mask Write Register request.
Definition: modbus_debug.c:694
__start_packed struct @225 ModbusWriteMultipleCoilsResp
Write Multiple Coils response PDU.
__start_packed struct @224 ModbusWriteMultipleCoilsReq
Write Multiple Coils request PDU.
__start_packed struct @226 ModbusWriteMultipleRegsReq
Write Multiple Registers request PDU.
error_t modbusDumpWriteMultipleRegsResp(const ModbusWriteMultipleRegsResp *response, size_t length)
Dump Write Multiple Registers response.
Definition: modbus_debug.c:671
error_t modbusDumpRequestPdu(const void *pdu, size_t length)
Dump Modbus request PDU for debugging purpose.
Definition: modbus_debug.c:97
error_t modbusDumpReadDiscreteInputsResp(const ModbusReadDiscreteInputsResp *response, size_t length)
Dump Read Discrete Inputs response.
Definition: modbus_debug.c:376
error_t modbusDumpReadCoilsReq(const ModbusReadCoilsReq *request, size_t length)
Dump Read Coils request.
Definition: modbus_debug.c:304
__start_packed struct @213 ModbusReadCoilsResp
Read Coils response PDU.
uint8_t length
Definition: dtls_misc.h:140
error_t modbusDumpReadInputRegsResp(const ModbusReadInputRegsResp *response, size_t length)
Dump Read Input Registers response.
Definition: modbus_debug.c:474
error_t modbusDumpWriteSingleRegReq(const ModbusWriteSingleRegReq *request, size_t length)
Dump Write Single Register request.
Definition: modbus_debug.c:546
error_t modbusDumpWriteMultipleCoilsResp(const ModbusWriteMultipleCoilsResp *response, size_t length)
Dump Write Multiple Coils response.
Definition: modbus_debug.c:620
__start_packed struct @212 ModbusReadCoilsReq
Read Coils request PDU.
error_t modbusDumpReadHoldingRegsResp(const ModbusReadHoldingRegsResp *response, size_t length)
Dump Read Holding Registers response.
Definition: modbus_debug.c:425
uint8_t pdu[]