COMM-DRV/Lib: FlushReceiveBuffer() Discards the contents of the receive buffer

Description-

Discards the contents of the receive buffer.

Syntax-

stat = FlushReceiveBuffer(port);

On Entry-

int port;

Port previously opened with OpenComPort().

On Exit-

int stat;

-1 If port was not initialized.

See Also-

IsReceiveBufferEmpty()
ReceiveBufferSize()
SpaceInReceiveBuffer()

Example-

#include “comm.h”

int port=0;
int stat;

if ((stat = FlushReceiveBuffer(port)) == -1)
{
printf(“Port not initialized\n”);

/* Take remedial action */
}