stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.44k stars 1.74k forks source link

Outdated documentation about tcp-pi requiring 1 KiB of extra memory #715

Closed psychon closed 2 months ago

psychon commented 1 year ago

libmodbus version

$ pkg-config --modversion libmodbus
Package libmodbus was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmodbus.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libmodbus', required by 'virtual:world', not found

OS and/or distribution

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux trixie/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=trixie
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Environment

$ uname -a
Linux ZweiLED 6.4.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1 (2023-08-17) x86_64 GNU/Linux

Description

Since https://github.com/stephane/libmodbus/issues/621 / commit https://github.com/stephane/libmodbus/commit/ef3c4bc989a4774402b89880d1afd54b1b6a1b67, modbus_new_tcp_pi no longer statically allocates 1 KiB of memory, but only as much as is actually required. (This was previously done through the array of size _MODBUS_TCP_PI_NODE_LENGTH in struct _modbus_tcp_pi).

However, the docs were not updated.

Actual behavior if applicable

https://github.com/stephane/libmodbus/blob/b25629bfb508bdce7d519884c0fa9810b7d98d44/docs/index.md#L109-L110

Expected behavior or suggestion

Contrary to the TCP IPv4 only backend, the TCP PI backend offers hostname 
resolution.

Steps to reproduce the behavior (commands or source code)

Compare the docs with what the implementation actually does.

libmodbus output with debug mode enabled

Uhm... Command not found, I guess.

psychon commented 2 months ago

Thanks!