Serial Communication - Flow Control not available in DCB

Started by georgek01, July 06, 2009, 06:37:30 AM

Previous topic - Next topic

georgek01

Hello!

I need to set the serial communication settings of a COM port but do not see a member in the DCB for flow control. Only the following members of the DCB structure is available:

dcb.BaudRate
dcb.ByteSize
dcb.Parity
dcb.StopBits
dcb.EofChar
dcb.ErrorChar
dcb.EvtChar
dcb.fbits
dcb.wReserved
dcb.wReserved1
dcb.XoffChar
dcb.XoffLim
dcb.XonChar
dcb.XonLim

How will I set flow control?
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

georgek01

I searched the forum and found the answer... guess I should have done that first  :wink

The fBits member of the DCB structure is a structure in itself. This is where flow control can be set:

mov  dcb.fbits, BITRECORD<\
TRUE,\   ; fBinary:1
FALSE,\   ; fParity:1
FALSE,\   ; fOutxCtsFlow:1
FALSE,\   ; fOutxDsrFlow:1
DTR_CONTROL_DISABLE,\   ; fDtrControl:2
FALSE,\   ; fDsrSensitivity:1
TRUE,\   ; fTXContinueOnXoff:1
FALSE,\   ; fOutX:1
FALSE,\   ; fInX:1
TRUE,\   ; fErrorChar:1
FALSE,\   ; fNull:1
RTS_CONTROL_DISABLE,\   ; fRtsControl:2
FALSE,\   ; fAbortOnError:1
NULL>   ; fDummy2:17
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

redskull

be cautious of the order the RECORD is defined in; masm records are backwards from C records

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

georgek01

i noticed that from one of your posts. it took some doing but it looks like it's working.

i also picked up that when i set StopBits to 1, fbits also change to 1 even when i set fbits to 0.

thanks.
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)