COMM-DRV/Lib: PutString() Outputs a null terminated string


This function outputs a null terminated string over the serial port. All characters preceding the null character are outputted. The null character is not outputted. This function will wait for up to the amount of time set by SetTimeout() before returning failure if the entire string is not written. It will also send the characters out at the pace specified by the SetPaceTime() function.


count = PutString(port,str);

On Entry-

int port;

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

char *str;

Pointer to null terminated string to output.

On Exit-

int count;

-1 If all characters outputted successfully.


Actual number of characters outputted.

See Also-



#include <comm.h>
int  port=0;
char buf[]="ABCDEF";
if (PutString(port,buf) != -1)
   printf("Entire string not outputted\n");