Question

I have a Linux application (whose code I have access) which must communicate via serial port with a windows one (third party, no access to code). The windows app runs in Wine, so I want to set Wine's com1 to something and make my software read and write from there. I guess the best way is to use pseudo-terminals, is that so?

Is there a way to simply create a pseudo-terminal pair from command line in Linux? I've already know how to do this using the API, but is there a way to do this from bash?

Maybe with socat or something like it?

Was it helpful?

Solution

You might be able to use something like this (untested):

socat PTY,link=$HOME/.wine/dosdevices/com1,raw,echo=0 PTY,link=$HOME/tmp/dev/myserial,raw,echo=0

This will create two back-to-back PTY's which is a bit of overkill, but socat will copy data between them. The wine program would open one side of the link as COM1, and your program would open $HOME/tmp/dev/myserial to communicate with COM1.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top