Skip to content

Commit

Permalink
updated libmodbus folder with qmodbus-code 6eeca6adecb09b8679c94edb37…
Browse files Browse the repository at this point in the history
…64c2e5a08d0e19
  • Loading branch information
daschuer committed Apr 9, 2014
1 parent 867167a commit 22e6cc4
Show file tree
Hide file tree
Showing 74 changed files with 614 additions and 1,532 deletions.
674 changes: 0 additions & 674 deletions 3rdparty/libmodbus/COPYING

This file was deleted.

16 changes: 14 additions & 2 deletions 3rdparty/libmodbus/NEWS
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
libmodbus 3.1.2 (2013-XX-XX)
libmodbus 3.1.2 (2014-XX-XX)
============================

If you still want to listen any addresses in your TCP IPv4 server, you must now
set the IP address to NULL in modbus_new_tcp before listening. Now,
modbus_tcp_listen only listen the IP address set in the Modbus context (see
documentation).

This release introduces API changes on modbus_get_byte_timeout,
modbus_get_response_timeout, modbus_set_byte_timeout,
modbus_set_response_timeout to ease writing of language bindings.

- Filter of IP addresses in IPv4 server (closes #190)
- Allow to listen any hosts in IPv6 (closes #32)
- Define and public export of MODBUS_MAX_PDU_LENGTH (closes #167)
- Truncate data from response in report_slave_id to new max arg (closes #167)
- Fix response timeout modification on connect (closes #80)
- New API to set/get response and byte timeouts.
New unit tests and updated documentation.
- Export Modbus function codes supported by libmodbus
- Fix bandwidth-server-one (closes #152)
- Check debug flag in RTU code
- Sync packaging with official from Debian (closes #134)
- Remove warnings caused by shadowed 'index' variable.
Thanks to Åke Forslund.
- Use accept4 in TCP PI if available
- Add documentation for tcp[_pi]_accept (closes #31)
- Fix mistake in modbus_tcp_listen documentation
- Add documentation for modbus_tcp_pi_listen
- Fix for MinGW and Windows (#144, #169, #175, #180, #181, #187)
Thanks to Marjan Tomas.
- Many other fixes (#134, #157, #158, #183, #184) and improvements.

libmodbus 3.1.1 (2013-10-06)
============================
Expand Down
4 changes: 1 addition & 3 deletions 3rdparty/libmodbus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ The functions included in the library have been derived from the Modicon Modbus
Protocol Reference Guide which can be obtained from Schneider at
[www.schneiderautomation.com](http://www.schneiderautomation.com).

The license of libmodbus is *LGPL v2.1 or later* and the licence of programs in
tests directory is GPL v3.
The license of libmodbus is *LGPL v2.1 or later*.

The documentation is available as manual pages (`man libmodbus` to read general
description and list of available functions) or Web pages
[www.libmodbus.org/documentation/](http://libmodbus.org/documentation/). The
documentation is licensed under the Creative Commons Attribution-ShareAlike
License 3.0 (Unported) (<http://creativecommons.org/licenses/by-sa/3.0/>).


The official website is [www.libmodbus.org](http://www.libmodbus.org).

The library is written in C and designed to run on Linux, Mac OS X, FreeBSD and
Expand Down
3 changes: 3 additions & 0 deletions 3rdparty/libmodbus/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@
/* Version number of package */
#define VERSION "3.1.1"

/* _ */
#define WINVER 0x0501

/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */

Expand Down
3 changes: 3 additions & 0 deletions 3rdparty/libmodbus/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ AC_CHECK_DECLS([__CYGWIN__])
AC_FUNC_FORK
AC_CHECK_FUNCS([accept4 getaddrinfo gettimeofday inet_ntoa memset select socket strerror strlcpy])

# Required for MinGW with GCC v4.8.1 on Win7
AC_DEFINE(WINVER, 0x0501, _)

# Required for getaddrinfo (TCP PI - IPv6)
AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
if test "x$HAVE_WINSOCK2_H" = "xyes"; then
Expand Down
1 change: 0 additions & 1 deletion 3rdparty/libmodbus/doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ MAN3 = \
modbus_read_input_registers.3 \
modbus_read_registers.3 \
modbus_receive_confirmation.3 \
modbus_receive_from.3 \
modbus_receive.3 \
modbus_reply_exception.3 \
modbus_reply.3 \
Expand Down
6 changes: 3 additions & 3 deletions 3rdparty/libmodbus/doc/libmodbus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ shall return either a NULL value (if returning a pointer) or a negative value
(if returning an integer), and the actual error code shall be stored in the
'errno' variable.

The _modbus_strerror()_ function is provided to translate libmodbus-specific
The *modbus_strerror()* function is provided to translate libmodbus-specific
error codes into error message strings; for details refer to
linkmb:modbus_strerror[3].

Expand Down Expand Up @@ -265,5 +265,5 @@ Report bugs on the issue tracker at
COPYING
-------
Free use of this software is granted under the terms of the GNU Lesser General
Public License (LGPL v2.1+). For details see the files `COPYING` and
`COPYING.LESSER` included with the libmodbus distribution.
Public License (LGPL v2.1+). For details see the file `COPYING.LESSER` included
with the libmodbus distribution.
2 changes: 1 addition & 1 deletion 3rdparty/libmodbus/doc/modbus_close.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_close()_ function shall close the connection established with the
The *modbus_close()* function shall close the connection established with the
backend set in the context.


Expand Down
8 changes: 4 additions & 4 deletions 3rdparty/libmodbus/doc/modbus_connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_connect()_ function shall etablish a connection to a Modbus server,
The *modbus_connect()* function shall etablish a connection to a Modbus server,
a network or a bus using the context information of libmodbus context given in
argument.


RETURN VALUE
------------
The modbus_connect() function shall return 0 if successful. Otherwise it shall
return -1 and set errno to one of the values defined by the system calls of the
underlying platform.
The function shall return 0 if successful. Otherwise it shall return -1 and set
errno to one of the values defined by the system calls of the underlying
platform.


EXAMPLE
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/libmodbus/doc/modbus_flush.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_flush()_ function shall discard data received but not read to the
The *modbus_flush()* function shall discard data received but not read to the
socket or file descriptor associated to the context 'ctx'.


RETURN VALUE
------------
The _modbus_flush()_ function shall return 0 or the number of flushed bytes if
The function shall return 0 or the number of flushed bytes if
successful. Otherwise it shall return -1 and set errno.


Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libmodbus/doc/modbus_free.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_free()_ function shall free an allocated modbus_t structure.
The *modbus_free()* function shall free an allocated modbus_t structure.


RETURN VALUE
Expand Down
7 changes: 3 additions & 4 deletions 3rdparty/libmodbus/doc/modbus_get_byte_from_bits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_byte_from_bits()_ function shall extract a value from many
bits. All 'nb_bits' bits from 'src' at position 'index' will be read as a
The *modbus_get_byte_from_bits()* function shall extract a value from many
bits. All _nb_bits_ bits from _src_ at position _index_ will be read as a
single value. To obtain a full byte, set nb_bits to 8.


RETURN VALUE
------------
The _modbus_get_byte_from_bits()_ function shall return a byte containing the
bits read.
The function shall return a byte containing the bits read.


SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libmodbus/doc/modbus_get_byte_timeout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_byte_timeout()_ function shall store the timeout interval
The *modbus_get_byte_timeout()* function shall store the timeout interval
between two consecutive bytes of the same message in the _to_sec_ and _to_usec_
arguments.

Expand Down
6 changes: 3 additions & 3 deletions 3rdparty/libmodbus/doc/modbus_get_float.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_float()_ function shall get a float from 4 bytes in Modbus
format (ABCD order). The 'src' array must be pointer on two 16 bits values, for
The *modbus_get_float()* function shall get a float from 4 bytes in Modbus
format (ABCD order). The _src_ array must be pointer on two 16 bits values, for
example, if the first word is set to 0x4465 and the second to 0x229a, the float
value will be 916.540649.


RETURN VALUE
------------
The _modbus_get_float()_ function shall return a float.
The function shall return a float.


SEE ALSO
Expand Down
6 changes: 3 additions & 3 deletions 3rdparty/libmodbus/doc/modbus_get_float_dcba.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_float_dcba()_ function shall get a float from 4 bytes in
inversed Modbus format (DCBA order). The 'src' array must be pointer on two 16
The *modbus_get_float_dcba()* function shall get a float from 4 bytes in
inversed Modbus format (DCBA order). The _src_ array must be pointer on two 16
bits values, for example, if the first word is set to 0x9a22 and the second to
0x6544, the float value read will be 916.540649.


RETURN VALUE
------------
The _modbus_get_float_dcba()_ function shall return a float.
The function shall return a float.


SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libmodbus/doc/modbus_get_header_length.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_header_length()_ function shall retrieve the current header
The *modbus_get_header_length()* function shall retrieve the current header
length from the backend. This function is convenient to manipulate a message and
so its limited to low-level operations.

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libmodbus/doc/modbus_get_response_timeout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_response_timeout()_ function shall return the timeout interval
The *modbus_get_response_timeout()* function shall return the timeout interval
used to wait for a response in the _to_sec_ and _to_usec_ arguments.


Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libmodbus/doc/modbus_get_socket.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_get_socket()_ function shall return the current socket or file
The *modbus_get_socket()* function shall return the current socket or file
descriptor of the libmodbus context.


Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/libmodbus/doc/modbus_mapping_free.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_mapping_free()_ function shall free the four arrays of mb_mapping_t
structure and finally the mb_mapping_t referenced by 'mb_mapping'.
The function shall free the four arrays of mb_mapping_t structure and finally
the mb_mapping_t referenced by _mb_mapping_.


RETURN VALUE
Expand Down
6 changes: 3 additions & 3 deletions 3rdparty/libmodbus/doc/modbus_mapping_new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_mapping_new()_ function shall allocate four arrays to store bits,
The *modbus_mapping_new()* function shall allocate four arrays to store bits,
input bits, registers and inputs registers. The pointers are stored in
modbus_mapping_t structure. All values of the arrays are initialized to zero.

Expand All @@ -26,8 +26,8 @@ This function is convenient to handle requests in a Modbus server/slave.

RETURN VALUE
------------
The _modbus_mapping_new()_ function shall return the new allocated structure if
successful. Otherwise it shall return NULL and set errno.
The function shall return the new allocated structure if successful. Otherwise
it shall return NULL and set errno.


ERRORS
Expand Down
6 changes: 3 additions & 3 deletions 3rdparty/libmodbus/doc/modbus_mask_write_register.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_mask_write_register()_ function shall modify the value of the
The *modbus_mask_write_register()* function shall modify the value of the
holding register at the address 'addr' of the remote device using the algorithm:

new value = (current value AND 'and') OR ('or' AND (NOT 'and'))
Expand All @@ -24,8 +24,8 @@ The function uses the Modbus function code 0x16 (mask single register).

RETURN VALUE
------------
The _modbus_mask_write_register()_ function shall return 1 if successful. Otherwise
it shall return -1 and set errno.
The function shall return 1 if successful. Otherwise it shall return -1 and set
errno.


SEE ALSO
Expand Down
11 changes: 5 additions & 6 deletions 3rdparty/libmodbus/doc/modbus_new_rtu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ SYNOPSIS

DESCRIPTION
-----------

The _modbus_new_rtu()_ function shall allocate and initialize a modbus_t
The *modbus_new_rtu()* function shall allocate and initialize a modbus_t
structure to communicate in RTU mode on a serial line.

The _device_ argument specifies the name of the serial port handled by the OS,
eg. '/dev/ttyS0' or '/dev/ttyUSB0'. On Windows, it's necessary to prepend COM
name with '\\.\' for COM number greater than 9, eg. '\\\\.\\COM10'. See
eg. "/dev/ttyS0" or "/dev/ttyUSB0". On Windows, it's necessary to prepend COM
name with "\\.\" for COM number greater than 9, eg. "\\\\.\\COM10". See
http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx for details

The _baud_ argument specifies the baud rate of the communication, eg. 9600,
Expand All @@ -41,8 +40,8 @@ and 2.

RETURN VALUE
------------
The _modbus_new_rtu()_ function shall return a pointer to a *modbus_t* structure
if successful. Otherwise it shall return NULL and set errno to one of the values
The function shall return a pointer to a _modbus_t_ structure if
successful. Otherwise it shall return NULL and set errno to one of the values
defined below.


Expand Down
15 changes: 8 additions & 7 deletions 3rdparty/libmodbus/doc/modbus_new_tcp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@ SYNOPSIS

DESCRIPTION
-----------
The _modbus_new_tcp()_ function shall allocate and initialize a modbus_t
structure to communicate with a Modbus TCP/IPv4 server.
The *modbus_new_tcp()* function shall allocate and initialize a modbus_t
structure to communicate with a Modbus TCP IPv4 server.

The _ip_ argument specifies the IP address of the server to which the client
wants etablish a connection.
wants etablish a connection. A NULL value can be used to listen any addresses in
server mode.

The _port_ argument is the TCP port to use. Set the port to
_MODBUS_TCP_DEFAULT_PORT_ to use the default one (502). It’s convenient to use a
`MODBUS_TCP_DEFAULT_PORT` to use the default one (502). It’s convenient to use a
port number greater than or equal to 1024 because it’s not necessary to have
administrator privileges.


RETURN VALUE
------------
The _modbus_new_tcp()_ function shall return a pointer to a *modbus_t* structure
if successful. Otherwise it shall return NULL and set errno to one of the values
The function shall return a pointer to a *modbus_t* structure if
successful. Otherwise it shall return NULL and set errno to one of the values
defined below.


Expand Down Expand Up @@ -60,7 +61,7 @@ if (modbus_connect(ctx) == -1) {

SEE ALSO
--------
linkmb:modbus_new_rtu[3]
linkmb:modbus_tcp_listen[3]
linkmb:modbus_free[3]


Expand Down
Loading

0 comments on commit 22e6cc4

Please sign in to comment.