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-2022 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.2.0
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
uint8_t length
Definition: coap_common.h:193
error_t modbusDumpReadCoilsResp(const ModbusReadCoilsResp *response, size_t length)
Dump Read Coils response.
Definition: modbus_debug.c:357
error_t modbusDumpReadCoilsReq(const ModbusReadCoilsReq *request, size_t length)
Dump Read Coils request.
Definition: modbus_debug.c:334
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
__start_packed struct @14 ModbusWriteMultipleCoilsResp
Write Multiple Coils response PDU.
__start_packed struct @20 ModbusReadWriteMultipleRegsResp
Read/Write Multiple Registers response PDU.
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
__start_packed struct @18 ModbusMaskWriteRegResp
Mask Write Register response PDU.
__start_packed struct @8 ModbusReadInputRegsResp
Read Holding Input response PDU.
error_t modbusDumpReadWriteMultipleRegsResp(const ModbusReadWriteMultipleRegsResp *response, size_t length)
Dump Read Write Multiple Registers response.
Definition: modbus_debug.c:802
__start_packed struct @11 ModbusWriteSingleRegReq
Write Single Register request PDU.
error_t modbusDumpWriteSingleCoilReq(const ModbusWriteSingleCoilReq *request, size_t length)
Dump Write Single Coil request.
Definition: modbus_debug.c:530
__start_packed struct @5 ModbusReadHoldingRegsReq
Read Holding Registers request PDU.
error_t modbusDumpExceptionResp(const ModbusExceptionResp *response, size_t length)
Dump Exception response.
Definition: modbus_debug.c:828
__start_packed struct @4 ModbusReadDiscreteInputsResp
Read Discrete Inputs response PDU.
error_t
Error codes.
Definition: error.h:43
__start_packed struct @9 ModbusWriteSingleCoilReq
Write Single Coil request PDU.
__start_packed struct @12 ModbusWriteSingleRegResp
Write Single Register response PDU.
uint8_t pdu[]
error_t modbusDumpWriteSingleCoilResp(const ModbusWriteSingleCoilResp *response, size_t length)
Dump Write Single Coil response.
Definition: modbus_debug.c:553
__start_packed struct @10 ModbusWriteSingleCoilResp
Write Single Coil response PDU.
__start_packed struct @13 ModbusWriteMultipleCoilsReq
Write Multiple Coils request PDU.
__start_packed struct @7 ModbusReadInputRegsReq
Read Holding Input request PDU.
__start_packed struct @16 ModbusWriteMultipleRegsResp
Write Multiple Registers response PDU.
error_t modbusDumpWriteSingleRegResp(const ModbusWriteSingleRegResp *response, size_t length)
Dump Write Single Register response.
Definition: modbus_debug.c:599
__start_packed struct @2 ModbusReadCoilsResp
Read Coils response PDU.
__start_packed struct @3 ModbusReadDiscreteInputsReq
Read Discrete Inputs request PDU.
__start_packed struct @19 ModbusReadWriteMultipleRegsReq
Read/Write Multiple Registers request PDU.
__start_packed struct @21 ModbusExceptionResp
Exception response PDU.
error_t modbusDumpWriteMultipleCoilsReq(const ModbusWriteMultipleCoilsReq *request, size_t length)
Dump Write Multiple Coils request.
Definition: modbus_debug.c:622
error_t modbusDumpWriteMultipleRegsResp(const ModbusWriteMultipleRegsResp *response, size_t length)
Dump Write Multiple Registers response.
Definition: modbus_debug.c:701
error_t modbusDumpReadDiscreteInputsReq(const ModbusReadDiscreteInputsReq *request, size_t length)
Dump Read Discrete Inputs request.
Definition: modbus_debug.c:383
__start_packed struct @15 ModbusWriteMultipleRegsReq
Write Multiple Registers request PDU.
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
__start_packed struct @17 ModbusMaskWriteRegReq
Mask Write Register request PDU.
__start_packed struct @6 ModbusReadHoldingRegsResp
Read Holding Registers 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:576
TCP/IP stack core.
__start_packed struct @1 ModbusReadCoilsReq
Read Coils request PDU.