I posted the same a week ago in FPC-devel, and did not get any feedback. I am posting the same here hoping to get some feedback :)
I have made some modifications to the windows unit of Luis R. Hilario B. in order to pave the way for cross-platform usage.
I would like to have feedback before touching the Unix serial unit.
Any testing and/or input is appreciated.
====================================================================== TSerialFlag has been introduced because the flags should not normally be mixed.
The following flow control options are available:
None
Xon/Xoff
RTS/CTS
DTR/DSR
TSerialFlags was left for compatibility reasons. It could be abolished in the future.
Procedure SerSet was overloaded to use both TSerialFlag and TSerialFlags.
If a port fails to open, SerOpen will return UnusedHandle to have multiplatform compatibility.
There are 2 constants in unit rtl\win\wininc\struct.inc that seem to be wrongly declared:
bm_DCB_fRtsControl = $3000. It should be $2000.
bm_DCB_fDtrControl = $30. It should be $20.
When these are corrected, the -$1000 and -$10 in the code below should be removed accordingly.
