ClearCommError

 
BOOL WINAPI ClearCommError(
  __in       HANDLE hFile,
  __out_opt  LPDWORD lpErrors,
  __out_opt  LPCOMSTAT lpStat
);

Parameters

hFile [in]

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

lpErrors [out, optional]

A pointer to a variable that receives a mask indicating the type of error. This parameter can be one or more of the following values.

ValueMeaning
CE_BREAK 0x0010

The hardware detected a break condition.

CE_FRAME 0x0008

The hardware detected a framing error.

CE_OVERRUN 0x0002

A character-buffer overrun has occurred. The next character is lost.

CE_RXOVER 0x0001

An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character.

CE_RXPARITY 0x0004

The hardware detected a parity error.

 

The following values are not supported:

CE_DNS
CE_IOE
CE_MODE
CE_OOP
CE_PTO
CE_TXFULL
lpStat [out, optional]

A pointer to a COMSTAT structure in which the device's status information is returned. If this parameter is NULL, no status information is returned.

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.

Remarks

If a communications port has been set up with a TRUE value for the fAbortOnError member of the setup DCB structure, the communications software will terminate all read and write operations on the communications port when a communications error occurs. No new read or write operations will be accepted until the application acknowledges the communications error by calling the ClearCommError function.

The ClearCommError function fills the status buffer pointed to by the lpStat parameter with the current status of the communications device specified by the hFile parameter.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值