-
Thank you @pboettch for initial proposal.
-
Useful functions when you are confronted with equipment which does not respect the protocol, which behaves strangely or when you wish to move away from the standard. Thank you @mhei for the great initial version.
-
Address check in single register / coil responses added According to Modbus standard the address of single register / coils request and response must match Co-authored-by: Heinrich Gsponer <heinrich.gsponer@siemens.com>
-
This native libmodbus error code is defined but not used.
-
While handling MODBUS_FC_WRITE_AND_READ_REGISTERS, both address offsets must be checked, i.e. the read and the write address must be within the mapping range. At the moment, only the read address was considered, it looks like a simple copy and paste error, so let's fix it. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
Thank you @qqq89513
-
Thanks to @peternewman
-
Since SPDX release 3.0 LGPL-2.1+ became LGPL-2.1-or-later. Hence replace the deprecated identifiers.
-
I can't believe I committed that copy/paste mistake. Sorry Maor Vermucht and Or Peles, excepted naming your original patch was OK. Thank you Karl Palsson for your review.
-
Closes #461
-
This patch was contributed by Maor Vermucht and Or Peles from VDOO Connected Trust.
-
I hope this was the correct place to fix it. I don't know asciidoc.
-
Found with the help of clang-format (from another branch)
-
According to the Modbus standard, the unit identifier is choosen by the TCP client and can be any value: "This field is used for intra-system routing purpose. It is typically used to communicate to a MODBUS+ or a MODBUS serial line slave through a gateway between an Ethernet TCP-IP network and a MODBUS serial line. This field is set by the MODBUS Client in the request and must be returned with the same value in the response by the server." So the current check in modbus_reply must be extended to check whether we are in a RTU or TCP context. Also the unit-test has to be adjusted. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
Thanks to paperwork
-
Thanks to Rüdiger Ranft for the idea.
-
Related to 52ab1bbea760ed8eaca184f7d875a2f52a116d0f. The arguments have been changed (see documentation). https://groups.google.com/d/msg/libmodbus/aXO8nBzW4Ew/uVGTDmvvBAAJ
-
This allows to place the coils/registers at any virtual start address, not only at address 0. This can be useful e.g. when the server has to fulfill a specification in which registers are expected at predefined locations. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
Thanks to @lipengin1975 for reporting this issue. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
According to the Modbus specification (http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf, section 2.1) a Modbus RTU master can send a broadcast to all of it's slaves. This broadcasts can only be write requests as otherwise collisions could occur, eg. on a RS-485 bus. When receiving such a broadcast, the slave should process the request as usual, but must not reply anything, neither a normal response nor an exception reply in case of an error. Adjust the unit test for this case, too. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
Do not allow raw request length longer than the PDU size plus the additional requested slave address byte. Without this check modbus_send_raw_request could be used to trigger a buffer overflow on the stack since the parameter is passed unchecked to memcpy. Thanks to Hanno Neuer for spotting this security flaw. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
This replaces the lengthy license text headers with a short and standardized license tag. See http://spdx.org for details. This is useful e.g. for license compliance tools which scan through files and generate a report of the licenses used in a project. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
This change has introduced by 83c34102. Fix unit tests on some systems.
-
Protects against crafted write requests with a large quantity but a small byte count. If address + quantity was in the mapping space of the server and quantity greater than the response size, it was possible to crash the server. The sleep/flush sequence improves the handling of following requests.