COMM-DRV/Lib: BytesInTransmitBuffer() Returns the number of bytes in the transmit buffer

Description-

Returns the number of bytes in the transmit buffer.

Syntax-

count = BytesInTransmitBuffer(port);

On Entry-

int port;

Port previously opened with OpenComPort().

On Exit-

int count;

Number of bytes in the transmit buffer.

else

-1 if port does not exist.

See Also-

IsTransmitBufferEmpty()
SpaceInTransmitBuffer()
TransmitBufferSize()

Example-

#include <comm.h>

int  count;
int  port=0;

if ((count = BytesInTransmitBuffer(port)) == -1)
    {
    printf("Port was not initialized\n");

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