[fpc-pascal] Serial Unit for Windows

Michael Van Canneyt michael at freepascal.org
Fri Jul 18 11:59:11 CEST 2008



On Fri, 18 Jul 2008, Stephano wrote:

> 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.

I looked at the unit the first time you posted it, but there is little
I can do: I don't do serial programming.

I think it is best if you contact someone who does serial programming
directly, and ask them to test this unit.

Michael.

> 
> ======================================================================
> 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.
> 
> 
> 



More information about the fpc-pascal mailing list