[fpc-pascal] Serial Unit for Windows

Stephano patspiper at yahoo.com
Sun Jul 20 07:08:49 CEST 2008


Zaher Dirkey wrote:
>>>    bm_DCB_fRtsControl = $3000. It should be $2000.
>>>    bm_DCB_fDtrControl = $30. It should be $20.
> 
> DtrControl and RtsControl have double bits so it should be as mask
> 
> in same struct.inc you can see
> 
>   function fDtrControl(var a : DCB) : DWORD;
>     begin
>        fDtrControl:=(a.flags and bm_DCB_fDtrControl) shr bp_DCB_fDtrControl;
>     end;
> 
How could I have missed that? I did not seek to interpret what the bm_ 
and bp_ were. Thanks for pointing that out.
Consequently, bm_DCB_fRtsControl ($3000) and bm_DCB_fDtrControl ($30) 
are correct.

> here fDtrControl return a number 0..3 as DWORD not boolean.
> 
> for your code is wrong becuase dtrcontrol/rtscontrol have 4 state not
> one as you use it
> 
True, but we do not need to expose the programmer to all of these 
states, do we? For example, in the Com port settings (Windows device 
manager), available options for the flow control (handshaking) are:
None
XOn/XOff
Hardware
What does hardware represent in terms of these flags?

Thanks



More information about the fpc-pascal mailing list