A buffer for receiving messages with flash memory?

In Win32 C, is there an API call to reset (reset) the contents of the COM port receive buffer? I could only find functions for flushing transfer buffers.

+3
source share
2 answers

`PurgeComm () ' can discard all characters in both or both of the Tx and Rx buffers and abort any pending read and / or write operations on the port. To do everything for the port, say something like:

PurgeComm(hPort, PURGE_RXABORT|PURGE_TXABORT|PURGE_RXCLEAR|PURGE_TXCLEAR) 

You can also make sure that you have processed or explicitly ignored any pending errors on the port, possibly with ClearCommError().

ReadFile() Rx- FIFO . , "" ReadFile(), .

, COMMTIMEOUTS "", , .

+7

, com-, ReadFile COM-

FlushFileBuffers

PurgeComm ( )

0

Source: https://habr.com/ru/post/1705758/


All Articles