-
Rename the function _modbus_tcp_init to _modbus_tcp_init_win32 and warp the call with #ifdef.
-
Before using any functions of the Win32 Socket API we first have to initialise it by calling WSAStartup(). Fixes non-working tests on native Win32. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
Some small modifications were neccessary to make libmodbus build using a MinGW (cross-)compiler. Libtool is now configured to build DLL files on Win32. The wsock32 library has been added to the list of libraries to link against. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
Reported by Viet Nguyen Quoc.
-
Added support for native Win32 based on https://code.launchpad.net/~thepyper/libmodbus/win32-native This mainly affects the RTU implementation as the TCP/IP socket interface is the same thanks to the winsocks library. The interface for using the serial port is completely different on Win32 and is now implemented accordingly. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
Introduced the select() operation for backends as the WAIT_DATA macro approach is not very extensible and causes trouble when adding platform- specific codepaths. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
On Win32 the second argument to recv() and send() is not a void pointer but a char pointer, therefore cast the buffer from uint8_t to char. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
There are several header files that are already included in modbus.h and thus do not have to be included in the C files. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
The send() and recv() functions of the backends might require more information than just a file descriptor, therefore pass the complete modbus_t structure. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
In modbus_flush() we should return the return value of the backend's flush() function. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
Renamed error_print() to _error_print() in order to indicate it's a private method and make it globally accessible so functions in modbus-rtu.c and modbus-tcp.c can make use of it as well. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
All declarations in modbus-rtu.h and modbus-tcp.h should be inside MODBUS_BEGIN_DECLS and MODBUS_END_DECLS in order to make that functions properly accessible in C++ files. Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
All private functions and constants are now prefixed by _. The modbus protocol uses entry points to call specific functions.
-
If <sys/time.h> is not included before "modbus.h" as struct timeval is not declared. This behavior was observed while building libmodbus for QNX. Signed-off-by: Matthias Weisser <weisserm@arcor.de>
-
- partial revert of 93ce13656103cbb459ebd630d055a008dbb059f3 - it was a bit confusing to always edit modbus.h.in - the header inclusion still unchanged (<modbus.h>)
-
Idea suggested by Hannu Vuolasaho
-
- return only useful data client side - available in TCP when a gateway to RTU is used - need to add isolated handling of indication/confirmation messages
-
- more coherent - namespace - opaque and smaller context - usual wording