| 1 | /* |
| 2 | * Copyright © Stéphane Raimbault <[email protected]> |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef MODBUS_TCP_H |
| 8 | #define MODBUS_TCP_Hcxx . . $ `src/modbus-tcp.h:8:9`! |
| 9 | |
| 10 | #include "modbus.h"cxx . . $ `<file>/src/modbus.h`/ |
| 11 | |
| 12 | MODBUS_BEGIN_DECLScxx . . $ `src/modbus.h:39:10`! |
| 13 | |
| 14 | #if defined(_WIN32) && !defined(__CYGWIN__) |
| 15 | /* Win32 with MinGW, supplement to <errno.h> */ |
| 16 | #include <winsock2.h> |
| 17 | #if !defined(ECONNRESET) |
| 18 | #define ECONNRESET WSAECONNRESET |
| 19 | #endif |
| 20 | #if !defined(ECONNREFUSED) |
| 21 | #define ECONNREFUSED WSAECONNREFUSED |
| 22 | #endif |
| 23 | #if !defined(ETIMEDOUT) |
| 24 | #define ETIMEDOUT WSAETIMEDOUT |
| 25 | #endif |
| 26 | #if !defined(ENOPROTOOPT) |
| 27 | #define ENOPROTOOPT WSAENOPROTOOPT |
| 28 | #endif |
| 29 | #if !defined(EINPROGRESS) |
| 30 | #define EINPROGRESS WSAEINPROGRESS |
| 31 | #endif |
| 32 | #endif |
| 33 | |
| 34 | #define MODBUS_TCP_DEFAULT_PORTcxx . . $ `src/modbus-tcp.h:34:9`! 502 |
| 35 | #define MODBUS_TCP_SLAVEcxx . . $ `src/modbus-tcp.h:35:9`! 0xFF |
| 36 | |
| 37 | /* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5 |
| 38 | * TCP MODBUS ADU = 253 bytes + MBAP (7 bytes) = 260 bytes |
| 39 | */ |
| 40 | #define MODBUS_TCP_MAX_ADU_LENGTHcxx . . $ `src/modbus-tcp.h:40:9`! 260 |
| 41 | |
| 42 | MODBUS_APIcxx . . $ `src/modbus.h:32:10`! modbus_tcxx . . $ modbus_t# *modbus_new_tcpcxx . . $ modbus_new_tcp(5f123d74b77c7850).(const char *ip_address, int port); |
| 43 | MODBUS_APIcxx . . $ `src/modbus.h:32:10`! int modbus_tcp_listencxx . . $ modbus_tcp_listen(2a7e0e283938d456).(modbus_tcxx . . $ modbus_t# *ctx, int nb_connection); |
| 44 | MODBUS_APIcxx . . $ `src/modbus.h:32:10`! int modbus_tcp_acceptcxx . . $ modbus_tcp_accept(e415c7f53a3f0b7).(modbus_tcxx . . $ modbus_t# *ctx, int *s); |
| 45 | |
| 46 | MODBUS_APIcxx . . $ `src/modbus.h:32:10`! modbus_tcxx . . $ modbus_t# *modbus_new_tcp_picxx . . $ modbus_new_tcp_pi(5f5df5bc2aa40d50).(const char *node, const char *service); |
| 47 | MODBUS_APIcxx . . $ `src/modbus.h:32:10`! int modbus_tcp_pi_listencxx . . $ modbus_tcp_pi_listen(2a7e0e283938d456).(modbus_tcxx . . $ modbus_t# *ctx, int nb_connection); |
| 48 | MODBUS_APIcxx . . $ `src/modbus.h:32:10`! int modbus_tcp_pi_acceptcxx . . $ modbus_tcp_pi_accept(e415c7f53a3f0b7).(modbus_tcxx . . $ modbus_t# *ctx, int *s); |
| 49 | |
| 50 | MODBUS_END_DECLScxx . . $ `src/modbus.h:40:10`! |
| 51 | |
| 52 | #endif /* MODBUS_TCP_H */ |