libmodbus icon indicating copy to clipboard operation
libmodbus copied to clipboard

RTU: don't abort if line control settings can't be set.

Open karlp opened this issue 10 years ago • 2 comments

While it's definitely a cause for concern if the line can't be set as expected, there are many useful situations where the line cannot be configured, but doesn't need to be. Aborting for those cases prevents the use of virtual serial ports for instance.

Signed-off-by: Karl Palsson [email protected]

This fixes: https://github.com/stephane/libmodbus/issues/234 allowing not just the serial to network forwarding from that issue, but also allows serial line snooping via:

socat -d -d -lu -x  PTY,link=/tmp/serial,raw /dev/ttyUSB1,raw

karlp avatar Feb 05 '15 09:02 karlp

Wouldn't it be better to detect such use cases by a stat call on the opened file and then by-pass the termios stuff when a fifo or socket is found?

mhei avatar Feb 08 '15 19:02 mhei

That does sound better, but only if it can be detected well enough.

karlp avatar Feb 09 '15 13:02 karlp