Virtual COM port emulation on Android

Questions about Wine on Android
Locked
fullhdfan
Newbie
Newbie
Posts: 1
Joined: Sat Aug 03, 2024 3:13 pm

Virtual COM port emulation on Android

Post by fullhdfan »

I have a Win32 app which sends data to an electronic PCB using the serial port (the data are written to a file open as "COM".
I couldn't run my app on Android until recently, when I discovered Winlator.
The only feature of the app that still doesn't work is the serial transmission.
When the app launches, I get this message :

"can't open COMx port" (return error from CreateFile function)

or this one :

"can't read the COMx state" (return error from GetCommState function)

windows.h and commctrl.h were used when I wrote the app in C long time ago.

To my current knowledge, it seems that it's not possible to use directly USB-to-serial adapters, because Android doesn't allow direct use of USB devices by other apps, so, it makes the issue practically impossible to solve.
Having found another Android app a couple of days ago (called "TCP-UART transparent bridge" - that works fine on my phone - it does send data to my USB-to-serial adapter) , the idea of using TCP (as bridge to cross/circumvent the Winlator/Android barrier) crossed my mind.

What I mean is this :

my app -> COM port -> TCP -> Android app -> USB-to-serial adapter

The only non-functional thing in the whole chain remains the COM port in Winlator. My app doesn't see it (maybe it really doesn't exist, at least a "dummy" one), even with the adapter driver installed (thing which didn't happen properly either).
I installed in Winlator COM-to-TCP forwarding software like this one :

https://www.hw-group.com/software/hw-vs ... erial-port

or this one :

https://sourceforge.net/projects/tcpcom32/

and a bunch of other similar, simpler, but much less functional in Winlator than the 2 above.

I assume it's a Wine thing. Is there currently a workaround to this ? If not, can I expect a solution to the problem in the next updates ?

Thanks.
Locked