COMM-DRV/Lib: SpaceInReceiveBuffer() Returns space unused in receive buffer

Description-

Returns space unused in receive buffer.

Syntax-

count = SpaceInReceiveBuffer(port);

On Entry-

int port;

Port previously opened with InitializePort() or OpenComPort().

On Exit-

int count;

Space available in the receive buffer.

else

-1 If port was not initialize.

See Also-

BytesInReceiveBuffer()
ReceiveBufferSize()
IsReceiveBufferEmpty()

Example-

#include “comm.h”

int count;
int port=0;

if ((count = SpaceInReceiveBuffer(port)) == -1)
{
printf(“Port was not initialized\n”);

/* Take remedial action */
}
else
printf(“Number of bytes =>%d\n”,count);