You need to sign in before continuing.
-
First, it's $host_os which should be checked, not $target (remember, 'build' is where we build, host is where the program will be run, and target is only for compiler - for which system the compiler will generate code. Second, correct OS pattern - e.g. on debian with i586-mingw32msvc-gcc, host_os is mingw32msvc, so we better for *mingw32*. Also, it's better to call AC_CANONICAL_* for normalizing variables. Build tested with `configure --host=i586-mingw32msvc` on Debian GNU/Linux 5.0 (Lenny). Cc: Александр Сёмуха <sav@mns.spb.ru> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
-
These functions have no meaning in RTU so it's better to specialize the names and remove them from the backend. - remove the functions from the backend - update tests to handle RTU mode (master and slave) - add command line options to tests (rtu or tcp)
-
- check strlcpy in configure.ac - test for empty device string - test truncated device string
-
When unitialized the socket can be 0 and write calls success.
-
modbus_set_slave must be used to set the slave ID of the remote device to talk in master mode and to set the internal slave ID in slave mode. If you talk to several devices, you need to call modbus_set_slave each time the following requests must be sent to another device.
-
- move termios header in RTU backend - move TCP headers in TCP backend - use native serial on Win32 for Cygwin - avoid too many defines
-
This change fixes a compilation problem in MinGW. As general rule, each header must be as independent as possible.
-
I prefer to remove the check rather than to add the solution used by Wine as we don't care about the associated define: AC_CHECK_HEADERS([ \ ... netinet/ip.h \ netinet/tcp.h \ ... ],,,[ #ifdef HAVE_NETINET_IP_H # include <netinet/ip.h> #endif ]) -
This change is asked by Barry Grumbine to fix build on OpenBSD
-
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.