본문 바로가기

Language & API/WIN API

SetCommMask 함수


Specifies a set of events to be monitored for a communications device.

통신 장치에 대해 모니터 이벤트 세트를 지정합니다.

 

Syntax

C++


1
2
3
4
BOOL WINAPI SetCommMask(
  _In_ HANDLE hFile,  // CreateFile HANDLE
  _In_ DWORD  dwEvtMask // EV_BREAK, EV_CTS, EV_DSR, EV_ERR, EV_RING, EV_RLSD, EV_RXCHAR, EV_RXFLAG, EV_TXEMPTY
);
cs


hFile [in]

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

CreateFile 핸들

dwEvtMask [in]

The events to be enabled. A value of zero disables all events. This parameter can be one or more of the following values.

이벤트를 작동 시킵니다. 0이면 모든 이벤트를 중지 시킵니다. 이 매개변수는 한 또는 이상을 지정할 있습니다.


Value

Meaning

EV_BREAK

0x0040

A break was detected on input.

입력시 끊어짐이 감지 되었습니다.

EV_CTS

0x0008

The CTS (clear-to-send) signal changed state.

CTS 시그널에 변화가 있습니다.

EV_DSR

0x0010

The DSR (data-set-ready) signal changed state.

DST 시그널에 변화가 있습니다.

EV_ERR

0x0080

A line-status error occurred. Line-status errors are CE_FRAMECE_OVERRUN, and CE_RXPARITY.

회선 상태 오류가 발생했습니다. 회선 상태 오류는 CE_FRAME, CE_OVERRUN CE_RXPARITY입니다.

EV_RING

0x0100

A ring indicator was detected.

링 표시기가 감지되었습니다.

EV_RLSD

0x0020

The RLSD (receive-line-signal-detect) signal changed state.

RLSD 스그널에 변화가 있습니다.

EV_RXCHAR

0x0001

A character was received and placed in the input buffer.

문자가 수신되어 입력 버퍼에 저장되었습니다.

EV_RXFLAG

0x0002

The event character was received and placed in the input buffer. The event character is specified in the device's DCB structure, which is applied to a serial port by using the SetCommState function.

이벤트 문자를 수신하여 입력 버퍼에 넣습니다. 이벤트 문자는 DCB 구조체에 서술되며

SetCommState 함수를 사용하여 시리얼 포트에 적용됩니다.

EV_TXEMPTY

0x0004

The last character in the output buffer was sent.

출력 버퍼의 마지막 문자가 전송되었습니다.

 

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.

만약 성공이면 Nonzero 값을 반환합니다.

만약 실패면 0 반환하고 GetLastError 함수에서 정보를 얻을수 있습니다

'Language & API > WIN API' 카테고리의 다른 글

WaitCommEvent 함수  (0) 2017.04.10