Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_W32_SetCommState
Return to Introduction  Previous page  Next page
This function sets the state of the device according to the contents of a device control block (DCB).

BOOL
FT_W32_SetCommState
(FT_HANDLE ftHandle, LPFTDCB lpftDcb)




Parameters
ftHandle
Handle of the device.
lpftDcb
Pointer to an FTDCB structure.




Return Value
If the function is successful, the return value is nonzero.
If the function is unsuccessful, the return value is zero.


Example
This example shows how to use this function to change the baud rate.

FT_HANDLE ftHandle; // setup by FT_W32_CreateFile
FTDCB ftDCB;

if (FT_W32_GetCommState(ftHandle,&ftDCB)) {
  // FT_W32_GetCommState ok, device state is in ftDCB
  ftDCB.BaudRate = 921600;
  if (FT_W32_SetCommState(ftHandle,&ftDCB))
    ; // FT_W32_SetCommState ok
  else
    ; // FT_W32_SetCommState failed
}
else
  ; // FT_W32_GetCommState failed