Results 1 to 3 of 3
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 ...
- 09-07-2005 #1
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 portand 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?Code:echo "data from deviceX" > /dev/ttyS0
- 09-07-2005 #2Just Joined!
- Join Date
- Sep 2005
- Posts
- 5
mkfifo
You may look into the mkfifo command with which you can create named pipes as follows:
Then you can with some program write data to it like:Code:mkfifo dummy_ttyS0
And read it (simultaneously) with an other program, e.g.:Code:echo "data from deviceX" > dummy_ttyS0
Code:cat dummy_ttyS0
- 09-07-2005 #3


Reply With Quote
