| 1 | /* |
| 2 | * Copyright © Stéphane Raimbault <[email protected]> |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef MODBUS_TCP_PRIVATE_H |
| 8 | #define MODBUS_TCP_PRIVATE_Hcxx . . $ `src/modbus-tcp-private.h:8:9`! |
| 9 | |
| 10 | #define _MODBUS_TCP_HEADER_LENGTHcxx . . $ `src/modbus-tcp-private.h:10:9`! 7 |
| 11 | #define _MODBUS_TCP_PRESET_REQ_LENGTHcxx . . $ `src/modbus-tcp-private.h:11:9`! 12 |
| 12 | #define _MODBUS_TCP_PRESET_RSP_LENGTHcxx . . $ `src/modbus-tcp-private.h:12:9`! 8 |
| 13 | |
| 14 | #define _MODBUS_TCP_CHECKSUM_LENGTHcxx . . $ `src/modbus-tcp-private.h:14:9`! 0 |
| 15 | |
| 16 | /* In both structures, the transaction ID must be placed on first position |
| 17 | to have a quick access not dependent of the TCP backend */ |
| 18 | typedef struct _modbus_tcpcxx . . $ _modbus_tcp# { |
| 19 | /* Extract from MODBUS Messaging on TCP/IP Implementation Guide V1.0b |
| 20 | (page 23/46): |
| 21 | The transaction identifier is used to associate the future response |
| 22 | with the request. This identifier is unique on each TCP connection. */ |
| 23 | uint16_tcxx . . $ uint16_t# t_idcxx . . $ _modbus_tcp#t_id.; |
| 24 | /* TCP port */ |
| 25 | int portcxx . . $ _modbus_tcp#port.; |
| 26 | /* IP address */ |
| 27 | char ipcxx . . $ _modbus_tcp#ip.[16]; |
| 28 | } modbus_tcp_tcxx . . $ modbus_tcp_t#; |
| 29 | |
| 30 | typedef struct _modbus_tcp_picxx . . $ _modbus_tcp_pi# { |
| 31 | /* Transaction ID */ |
| 32 | uint16_tcxx . . $ uint16_t# t_idcxx . . $ _modbus_tcp_pi#t_id.; |
| 33 | /* TCP port */ |
| 34 | int portcxx . . $ _modbus_tcp_pi#port.; |
| 35 | /* Node */ |
| 36 | char *nodecxx . . $ _modbus_tcp_pi#node.; |
| 37 | /* Service */ |
| 38 | char *servicecxx . . $ _modbus_tcp_pi#service.; |
| 39 | } modbus_tcp_pi_tcxx . . $ modbus_tcp_pi_t#; |
| 40 | |
| 41 | #endif /* MODBUS_TCP_PRIVATE_H */ |