EscapeCommFunction function

Directs the specified communications device to perform an extended function.

Syntax


BOOL WINAPI EscapeCommFunction(
  _In_ HANDLE hFile,
  _In_ DWORD  dwFunc
);

Parameters

hFile [in]

A handle to the communications device. The CreateFile function returns this handle.

dwFunc [in]

The extended function to be performed. This parameter can be one of the following values.

ValueMeaning
CLRBREAK
9

Restores character transmission and places the transmission line in a nonbreak state. The CLRBREAK extended function code is identical to the ClearCommBreak function.

CLRDTR
6

Clears the DTR (data-terminal-ready) signal.

CLRRTS
4

Clears the RTS (request-to-send) signal.

SETBREAK
8

Suspends character transmission and places the transmission line in a break state until the ClearCommBreak function is called (or EscapeCommFunction is called with the CLRBREAK extended function code). The SETBREAK extended function code is identical to the SetCommBreak function. Note that this extended function does not flush data that has not been transmitted.

SETDTR
5

Sends the DTR (data-terminal-ready) signal.

SETRTS
3

Sends the RTS (request-to-send) signal.

SETXOFF
1

Causes transmission to act as if an XOFF character has been received.

SETXON
2

Causes transmission to act as if an XON character has been received.

 

Return value

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.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

ClearCommBreak
Communications Functions
Communications Resources
CreateFile
SetCommBreak

 

 

Show: