You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as already predicted in the comment modbus.h, the restriction of having only 16 bytes for the device name becomes a problem when using udev-created symlinks on Linux, as they tend to be way longer than 16 bytes.
a) Maybe it could always be 64 bytes, independently of the OS used?
b) Maybe it could even be a pointer to a string, thus allowing an arbitrary length of the device-name?
I'd vote for a), as it actually reduces complexity and most probably solves the problem for now.
The text was updated successfully, but these errors were encountered:
I am using version 3.0.1 on Ubuntu (installed using apt-get), and long device names still seem to cause failure.
When I called my device "/dev/tty-dat3018", then when modbus_new_rtu() was called, I got the error message:
"The device string has been truncated" and an error was returned, whereas when I shortened the name to "/dev/ttyMODBUS0", the program started working fine. Therefore it seems that 15 characters + NUL is ok, but 16 chars + NUL = Failure.
I hope that this problem is just due to the changes taking time to propagate to the Ubuntu distribution rather than another problem. For the moment I can just rename my devices to short names.
as already predicted in the comment modbus.h, the restriction of having only 16 bytes for the device name becomes a problem when using udev-created symlinks on Linux, as they tend to be way longer than 16 bytes.
a) Maybe it could always be 64 bytes, independently of the OS used?
b) Maybe it could even be a pointer to a string, thus allowing an arbitrary length of the device-name?
I'd vote for a), as it actually reduces complexity and most probably solves the problem for now.
The text was updated successfully, but these errors were encountered: