COMM-DRV/Lib: BytesInReceiveBuffer() Returns the number of bytes in the receive buffer.

Description-

Returns the number of bytes in the receive buffer.

Syntax-

count = BytesInReceiveBuffer(port);

On Entry-

int port;

Port previously opened with OpenComPort().

On Exit-

int count;

Number of bytes in the receive buffer.

else

-1 if port is not active.

See Also-

IsReceiveBufferEmpty()
ReceiveBufferSize()
SpaceInReceiveBuffer()

Example-

#include <comm.h>
int  count;
int  port=0;
if ((count = BytesInReceiveBuffer(port)) == -1)
   {
   printf("Port was not initialized\n");
   /* Take remedial action */
   }
else
   printf("Number of byte =>%d\n",count);