COMM-DRV/Lib: SpaceInTransmitBuffer() Returns space unused in transmit buffer

Description-

Returns space unused in transmit buffer.

Syntax-

count = SpaceInTransmitBuffer(port);

On Entry-

int port;

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

On Exit-

int count;

Space available in the transmit buffer.

else

-1 If port is not active.

See Also-

BytesInTransmitBuffer()
TransmitBufferSize()
IsTransmitBufferEmpty()

Example-

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