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?
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
be cautious of the order the RECORD is defined in; masm records are backwards from C records
-r
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.