I have a program written in c++/QT communicating with external devices via the serial port. Now I want to log what the program is writing, and what receiving, but without interfering with the program. Thus I wanted to create a virtual serial port connecting the logging program and the original program, while the logging program is connected to the real serial port. That would enable two things: Logging of the commands without interfering, and enabling a test mode, where the logging program just writes values back without being connected to a real serial port.
My problem is: When using socat, I run in the problem described here. When using tty0tty, I get a compilation error described here.
Thus, what can I do in order to place a logging program in between the original program and the serial port? The original program uses QSerialPortInfo in order to get the available serial ports, rendering socat useless.