Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-07

Serial unit for windows

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Stephano

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.

Reply by email