我想知道是否有任何类似于 IsBufferEmpty() 的函数可以在同步句柄上使用,而不是使用 ReadFile() 并等待它返回 false。我需要一些东西来消除 ReadFile() 尝试读取数据的延迟。
Schuyler
问问题
463 次
1 回答
1
这是用于串口通信吗?
如果是这样,您可以使用以下ClearCommError()
功能:
DWORD com_errors = 0;
COMSTAT com_stat;
ClearCommError(serial_port_handle, &com_errors, &com_stat);
/* com_stat.cbInQue now holds the number of characters in the receive buffer */
于 2009-06-02T14:48:51.417 回答