COMM-DRV/Lib: SetTimeout() Sets the current transmit/receive timeouts

Description-

Sets the current transmit/receive time-outs. This is the amount of time that the high level functions that send and receive data will delay before returning an error, if they cannot send data (because output buffer may be full) or did not receive data respectively.

Syntax-

stat = SetTimeout(port,timeval);

On Entry-

int port;

Port previously opened with OpenComPort().

int timeval;

Time-out in timer tics. The resolution of the timer tic is set by the function CdrvSetTimerResolution().

On Exit-

int stat;

0 If successful.

else

-1 If port not initialized.

See Also-

GetTimeout()

Example-

#include "comm.h"
int port=0;
 int stat;
if ((stat = SetTimeout(port,20)) != 0)
    {
    printf("Port not initialized\n");
    /* Take remedial action */
   }