Adventures in serial port.
ssnell at austechinfo.com.au
Mon Aug 16 03:43:45 CDT 2004
I have been trying for several weeks to transfer our product to linux using
wine. I am so close it hurts! The only issue has been the serial ports.
Threads, sockets, and timers appear to be working as advertised (an
impressive feat of wine as it is!). However the serial port has failed me.
I have used versions 20040716 and 20040505 both as RPM's and source code
(with various patches applied to the source). The major issue is
reliability. I can successfully get test programs to echo back a character
received on the serial port. However when I use the port in anger it often
drops bytes. Calls to ReadFile will drop the last byte when the packet size
is 30 bytes, and up to the last 5 bytes when the packet size is 200+ bytes.
After a while calls to WriteFile will actually stop sending bytes even
though it returns successfully. The program has several threads but I have
modified it so that the calls to ReadFile/Writfile are in the same thread
inside a loop. I set the timeout parameters to return immediately from a
ReadFile with any available bytes. If you are interested I can post the
shell of my code.
Unfortunately the sands of time keep flowing and I am under pressure to find
a solution. I have decided to use winelib to build our program that uses
the serial port and write native code to read/write to the serial port. The
rest of the suite I will continue to use with wine. This has gone well so
far and again I am suprised at how smoothly I can do things, this time with
winelib/winemaker. However I have struck a problem. My windows program
code links in a .lib file that is provided by a third party. Can I link
this library file into my winelib project, and if so how? I cant seem to
find any recent discussion on this topic so if you could point me to some I
would be very grateful.
More information about the wine-devel