The SetCommState function 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.
BOOL SetCommState(
HANDLE hFile, |
// handle of communications device |
LPDCB lpDCB |
// address of device-control block structure |
); |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The SetCommState function uses a DCB structure to specify the desired configuration. The GetCommState function 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.
The SetCommState function 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:
BuildCommDCB, CreateFile, DCB, GetCommState
file: /Techref/os/win/api/win32/func/src/f77_3.htm, 3KB, , updated: 2000/4/7 11:19, local time: 2024/11/29 17:16,
3.138.122.90:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/Techref/os/win/api/win32/func/src/f77_3.htm"> SetCommState</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.