Need software loopback on com port.
The question is: how can I make the data written to the COM port to be available back for read immediately? In other words I need software loopback on com port.
Some briefing: I wrote an application that reads data sent by some industrial machine, parses it, and writes results somewhere. The problem is that it's not so easy to go to the customer place and get connected to that device in order to make application tests. So I need to simulate data being written to the port. That's why I bought a 9-pin COM socket, and connected the appropriate pins to each other to get COM port loopback device. Then I send data to the port
and that line can be read by application. Everything works fine, but... I want to achieve the same functionality without that loopback device, cause first: my com port is always in use, but I need it for other purposes and second: I'm afraid to burn up my only com port on laptop with such experiments one day. Is this can be done with pipes and device files, if yes then how?
echo "data from deviceX" > /dev/ttyS0