[fpc-devel] Serial unit for windows

Stephano patspiper at yahoo.com
Sat Jul 12 17:36:16 CEST 2008


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

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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: serial.pp
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080712/01bc5ee0/attachment.ksh>


More information about the fpc-devel mailing list