I have a project that contains some unitary tests used to test serial communication using COM ports (in windows). I use com0com to create a virtual pair of restricted ports and run tests.
However, I do not know how to do this in Linux nor in MACOS. I read this topic: Is there some kind of program, for example COM0COM in linux? Where the answer suggests using socat. I tried this approach, but it does not work, my application does not detect the ports that I just defined in socat.
socat PTY,link=/dev/COM98 PTY,link=/dev/COM99
My theory is that socat cannot create virtual ports, it can only bind existing ports.
How can I solve this problem?
Thank!
EDIT:
This is what I get after running the previous socat command. If you look carefully, you will see that the COM98 and COM99 ports are in / dev /. However, if I write to / dev / COM 98 and use tail -f to follow COM99, I get no output from it.

EDIT2:
Well, if I use cat instead of a tail, I can see the result (why ?!)

EDIT3:
SOLUTION: Do not name the ports COMxx, but ttySxx instead!
Example:
socat PTY,link=/dev/ttyS98 PTY,link=/dev/ttyS99
Reason: Some serial number libraries may not support other nomenclature, such as RXTX 2.XX and previous versions.