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  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.6
29  **/
30 
31 #ifndef _MODBUS_DEBUG_H
32 #define _MODBUS_DEBUG_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "modbus/modbus_common.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //Modbus/TCP related functions
44 error_t modbusDumpRequestPdu(const void *pdu, size_t length);
45 error_t modbusDumpResponsePdu(const void *pdu, size_t length);
46 
48  size_t length);
49 
51  size_t length);
52 
54  size_t length);
55 
57  size_t length);
58 
60  size_t length);
61 
63  size_t length);
64 
66  size_t length);
67 
69  size_t length);
70 
72  size_t length);
73 
75  size_t length);
76 
78  size_t length);
79 
81  size_t length);
82 
84  size_t length);
85 
87  size_t length);
88 
90  size_t length);
91 
93  size_t length);
94 
96  size_t length);
97 
99  size_t length);
100 
102  size_t length);
103 
105  size_t length);
106 
108  size_t length);
109 
110 //C++ guard
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif
error_t modbusDumpReadHoldingRegsReq(const ModbusReadHoldingRegsReq *request, size_t length)
Dump Read Holding Registers request.
Definition: modbus_debug.c:404
uint8_t length
Definition: dtls_misc.h:149
__start_packed struct @228 ModbusReadWriteMultipleRegsResp
Read/Write Multiple Registers response PDU.
error_t modbusDumpReadCoilsResp(const ModbusReadCoilsResp *response, size_t length)
Dump Read Coils response.
Definition: modbus_debug.c:329
error_t modbusDumpReadCoilsReq(const ModbusReadCoilsReq *request, size_t length)
Dump Read Coils request.
Definition: modbus_debug.c:306
error_t modbusDumpWriteMultipleCoilsResp(const ModbusWriteMultipleCoilsResp *response, size_t length)
Dump Write Multiple Coils response.
Definition: modbus_debug.c:622
__start_packed struct @222 ModbusWriteMultipleCoilsResp
Write Multiple Coils response PDU.
error_t modbusDumpReadHoldingRegsResp(const ModbusReadHoldingRegsResp *response, size_t length)
Dump Read Holding Registers response.
Definition: modbus_debug.c:427
error_t modbusDumpReadInputRegsResp(const ModbusReadInputRegsResp *response, size_t length)
Dump Read Input Registers response.
Definition: modbus_debug.c:476
__start_packed struct @223 ModbusWriteMultipleRegsReq
Write Multiple Registers request PDU.
__start_packed struct @229 ModbusExceptionResp
Exception response PDU.
error_t modbusDumpReadInputRegsReq(const ModbusReadInputRegsReq *request, size_t length)
Dump Read Input Registers request.
Definition: modbus_debug.c:453
__start_packed struct @217 ModbusWriteSingleCoilReq
Write Single Coil request PDU.
error_t modbusDumpReadWriteMultipleRegsReq(const ModbusReadWriteMultipleRegsReq *request, size_t length)
Dump Read Write Multiple Registers request.
Definition: modbus_debug.c:744
__start_packed struct @210 ModbusReadCoilsResp
Read Coils response PDU.
error_t modbusDumpReadWriteMultipleRegsResp(const ModbusReadWriteMultipleRegsResp *response, size_t length)
Dump Read Write Multiple Registers response.
Definition: modbus_debug.c:774
__start_packed struct @224 ModbusWriteMultipleRegsResp
Write Multiple Registers response PDU.
error_t modbusDumpWriteSingleCoilReq(const ModbusWriteSingleCoilReq *request, size_t length)
Dump Write Single Coil request.
Definition: modbus_debug.c:502
__start_packed struct @225 ModbusMaskWriteRegReq
Mask Write Register request PDU.
error_t modbusDumpExceptionResp(const ModbusExceptionResp *response, size_t length)
Dump Exception response.
Definition: modbus_debug.c:800
error_t
Error codes.
Definition: error.h:42
__start_packed struct @214 ModbusReadHoldingRegsResp
Read Holding Registers response PDU.
__start_packed struct @213 ModbusReadHoldingRegsReq
Read Holding Registers request PDU.
__start_packed struct @209 ModbusReadCoilsReq
Read Coils request PDU.
uint8_t pdu[]
error_t modbusDumpWriteSingleCoilResp(const ModbusWriteSingleCoilResp *response, size_t length)
Dump Write Single Coil response.
Definition: modbus_debug.c:525
__start_packed struct @219 ModbusWriteSingleRegReq
Write Single Register request PDU.
__start_packed struct @221 ModbusWriteMultipleCoilsReq
Write Multiple Coils request PDU.
error_t modbusDumpWriteSingleRegResp(const ModbusWriteSingleRegResp *response, size_t length)
Dump Write Single Register response.
Definition: modbus_debug.c:571
__start_packed struct @227 ModbusReadWriteMultipleRegsReq
Read/Write Multiple Registers request PDU.
__start_packed struct @226 ModbusMaskWriteRegResp
Mask Write Register response PDU.
error_t modbusDumpWriteMultipleCoilsReq(const ModbusWriteMultipleCoilsReq *request, size_t length)
Dump Write Multiple Coils request.
Definition: modbus_debug.c:594
__start_packed struct @218 ModbusWriteSingleCoilResp
Write Single Coil response PDU.
error_t modbusDumpWriteMultipleRegsResp(const ModbusWriteMultipleRegsResp *response, size_t length)
Dump Write Multiple Registers response.
Definition: modbus_debug.c:673
__start_packed struct @211 ModbusReadDiscreteInputsReq
Read Discrete Inputs request PDU.
error_t modbusDumpReadDiscreteInputsReq(const ModbusReadDiscreteInputsReq *request, size_t length)
Dump Read Discrete Inputs request.
Definition: modbus_debug.c:355
__start_packed struct @215 ModbusReadInputRegsReq
Read Holding Input request PDU.
error_t modbusDumpResponsePdu(const void *pdu, size_t length)
Dump Modbus response PDU for debugging purpose.
Definition: modbus_debug.c:198
Definitions common to Modbus/TCP client and server.
__start_packed struct @220 ModbusWriteSingleRegResp
Write Single Register response PDU.
error_t modbusDumpReadDiscreteInputsResp(const ModbusReadDiscreteInputsResp *response, size_t length)
Dump Read Discrete Inputs response.
Definition: modbus_debug.c:378
error_t modbusDumpMaskWriteRegReq(const ModbusMaskWriteRegReq *request, size_t length)
Dump Mask Write Register request.
Definition: modbus_debug.c:696
error_t modbusDumpWriteMultipleRegsReq(const ModbusWriteMultipleRegsReq *request, size_t length)
Dump Write Multiple Registers request.
Definition: modbus_debug.c:645
error_t modbusDumpMaskWriteRegResp(const ModbusMaskWriteRegResp *response, size_t length)
Dump Mask Write Register response.
Definition: modbus_debug.c:720
__start_packed struct @212 ModbusReadDiscreteInputsResp
Read Discrete Inputs response PDU.
error_t modbusDumpRequestPdu(const void *pdu, size_t length)
Dump Modbus request PDU for debugging purpose.
Definition: modbus_debug.c:99
error_t modbusDumpWriteSingleRegReq(const ModbusWriteSingleRegReq *request, size_t length)
Dump Write Single Register request.
Definition: modbus_debug.c:548
TCP/IP stack core.
__start_packed struct @216 ModbusReadInputRegsResp
Read Holding Input response PDU.