KsEscapeCommFunction

The availability of this function depends on what the device supports.

Directs the specified communications device to perform an extended function.

Syntax

BOOL KsEscapeCommFunction(
     HANDLE hFile,
     DWORD dwFunc
);

Parameters

hFile: a handle to the communications device. The KsCreateComm function returns this handle.

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

Value Description

CLRBREAK

9

Restores character transmission and places the transmission line in a nonbreak state. The CLRBREAK extended function code is identical to the KsClearCommBreak 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 KsClearCommBreak function is called (or KsEscapeCommFunction is called with the CLRBREAK extended function code). The SETBREAK extended function code is identical to the KsSetCommBreak 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, it returns TRUE, otherwise FALSE. To get extended error information, call GetLastError.

Example

N/A

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header kscom.h kscom.h
Library KsApi_Rtss.lib ksapi.h

See also

KsCreateComm

KsClearCommBreak

KsSetCommBreak