Configures a communications device according to the specifications in a device-control block (a DCB structure). The function reinitializes all hardware and control settings, but it does not empty output or input queues.
BOOLEAN SetCommState( COMMHANDLE hComm, // handle to communications device LPDCB lpDCB // device-control block );
hComm
lpDCB
0
(zero)
E_BUSY
E_DISCONNECTED
E_PARAM
This function uses a DCB structure to specify the desired configuration. GetCommState returns the current configuration.
To set only a few members of the DCB structure, you should modify a DCB structure that has been filled in by a call to GetCommState. This ensures that the other members of the DCB structure have appropriate values.
SetCommState fails if the XonChar member of the DCB structure is equal to the XoffChar member.
When SetCommState is used to configure the 8250, the following restrictions apply to the values for the DCB structure's ByteSize and StopBits members:
The number of data bits must be 5 to 8 bits.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.1 | intime/rt/include/comm.h | comm.h | comm.lib |