Thanks to Bernhard Agthe.
@@ -21,6 +21,8 @@
#include "modbus.h"
+MODBUS_BEGIN_DECLS
+
/* Modbus_Application_Protocol_V1_1b.pdf Chapter 4 Section 1 Page 5
* RS232 / RS485 ADU = 253 bytes + slave (1 byte) + CRC (2 bytes) = 256 bytes
*/
@@ -35,4 +37,6 @@ modbus_t* modbus_new_rtu(const char *device, int baud, char parity,
int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode);
int modbus_rtu_get_serial_mode(modbus_t *ctx);
+MODBUS_END_DECLS
#endif /* _MODBUS_RTU_H_ */
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Win32 with MinGW, supplement to <errno.h> */
#include <winsock2.h>
@@ -46,4 +48,6 @@ modbus_t* modbus_new_tcp_pi(const char *node, const char *service);
int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection);
int modbus_tcp_pi_accept(modbus_t *ctx, int *socket);
#endif /* _MODBUS_TCP_H_ */