I have two boards and they are connected using a UART connection (TX, RX, CTS, RTS). The problem is that I have 2 processes that needs to use the same serial port. Graphically, the problem looks like this:
Process A1 (Host) --- | Physical Serial Connection |--- Process A2 (Controller)
Process B1 (Host) --- | Physical Serial Connection |--- Process B2 (Controller)
Basically, Process A1 from Board 1 communicates with Process A2 from Board 2. Similar for B1 and B2. Same Physical Serial Connection is used.
How could I share the same physical serial connection between the two processes? I don't want to modify the code on the application side, so everything should be transparent to the application. I was thinking of using a protocol similar to GSM 07.10 (https://www.kernel.org/doc/html/latest/driver-api/serial/n_gsm.html) that creates several virtual tty for the same serial connection then it takes care of multiplexing/demultiplexing. However, it looks that GSM 07.10 is not maintained anymore in the Linux Kernel so I was thinking of alternatives. Could you advise?