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-2024 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 2.4.4
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:432
ModbusWriteSingleCoilReq
ModbusReadHoldingRegsResp
error_t modbusDumpReadCoilsResp(const ModbusReadCoilsResp *response, size_t length)
Dump Read Coils response.
Definition: modbus_debug.c:357
ModbusReadDiscreteInputsResp
error_t modbusDumpReadCoilsReq(const ModbusReadCoilsReq *request, size_t length)
Dump Read Coils request.
Definition: modbus_debug.c:334
ModbusExceptionResp
error_t modbusDumpWriteMultipleCoilsResp(const ModbusWriteMultipleCoilsResp *response, size_t length)
Dump Write Multiple Coils response.
Definition: modbus_debug.c:650
error_t modbusDumpReadHoldingRegsResp(const ModbusReadHoldingRegsResp *response, size_t length)
Dump Read Holding Registers response.
Definition: modbus_debug.c:455
error_t modbusDumpReadInputRegsResp(const ModbusReadInputRegsResp *response, size_t length)
Dump Read Input Registers response.
Definition: modbus_debug.c:504
ModbusWriteSingleCoilResp
ModbusWriteMultipleRegsReq
error_t modbusDumpReadInputRegsReq(const ModbusReadInputRegsReq *request, size_t length)
Dump Read Input Registers request.
Definition: modbus_debug.c:481
error_t modbusDumpReadWriteMultipleRegsReq(const ModbusReadWriteMultipleRegsReq *request, size_t length)
Dump Read Write Multiple Registers request.
Definition: modbus_debug.c:772
ModbusWriteMultipleRegsResp
error_t modbusDumpReadWriteMultipleRegsResp(const ModbusReadWriteMultipleRegsResp *response, size_t length)
Dump Read Write Multiple Registers response.
Definition: modbus_debug.c:802
ModbusReadInputRegsResp
ModbusMaskWriteRegReq
ModbusWriteSingleRegReq
error_t modbusDumpWriteSingleCoilReq(const ModbusWriteSingleCoilReq *request, size_t length)
Dump Write Single Coil request.
Definition: modbus_debug.c:530
error_t modbusDumpExceptionResp(const ModbusExceptionResp *response, size_t length)
Dump Exception response.
Definition: modbus_debug.c:828
error_t
Error codes.
Definition: error.h:43
ModbusWriteMultipleCoilsReq
uint8_t pdu[]
error_t modbusDumpWriteSingleCoilResp(const ModbusWriteSingleCoilResp *response, size_t length)
Dump Write Single Coil response.
Definition: modbus_debug.c:553
error_t modbusDumpWriteSingleRegResp(const ModbusWriteSingleRegResp *response, size_t length)
Dump Write Single Register response.
Definition: modbus_debug.c:599
uint8_t length
Definition: tcp.h:368
error_t modbusDumpWriteMultipleCoilsReq(const ModbusWriteMultipleCoilsReq *request, size_t length)
Dump Write Multiple Coils request.
Definition: modbus_debug.c:622
ModbusWriteMultipleCoilsResp
error_t modbusDumpWriteMultipleRegsResp(const ModbusWriteMultipleRegsResp *response, size_t length)
Dump Write Multiple Registers response.
Definition: modbus_debug.c:701
ModbusReadCoilsResp
error_t modbusDumpReadDiscreteInputsReq(const ModbusReadDiscreteInputsReq *request, size_t length)
Dump Read Discrete Inputs request.
Definition: modbus_debug.c:383
ModbusMaskWriteRegResp
error_t modbusDumpResponsePdu(const void *pdu, size_t length)
Dump Modbus response PDU for debugging purpose.
Definition: modbus_debug.c:212
Definitions common to Modbus/TCP client and server.
error_t modbusDumpReadDiscreteInputsResp(const ModbusReadDiscreteInputsResp *response, size_t length)
Dump Read Discrete Inputs response.
Definition: modbus_debug.c:406
error_t modbusDumpMaskWriteRegReq(const ModbusMaskWriteRegReq *request, size_t length)
Dump Mask Write Register request.
Definition: modbus_debug.c:724
error_t modbusDumpWriteMultipleRegsReq(const ModbusWriteMultipleRegsReq *request, size_t length)
Dump Write Multiple Registers request.
Definition: modbus_debug.c:673
error_t modbusDumpMaskWriteRegResp(const ModbusMaskWriteRegResp *response, size_t length)
Dump Mask Write Register response.
Definition: modbus_debug.c:748
ModbusReadCoilsReq
ModbusReadInputRegsReq
ModbusReadDiscreteInputsReq
ModbusWriteSingleRegResp
ModbusReadWriteMultipleRegsReq
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:576
TCP/IP stack core.
ModbusReadHoldingRegsReq
ModbusReadWriteMultipleRegsResp