COMM-DRV/Lib: SetBaud() Sets new baud rate


This function sets the baud rate on a particular port.


stat = SetBaud(port,baud);

On Entry-

int port;

Port previously opened with OpenComPort().

unsigned short baud;

BAUD110 110 baud
BAUD150 150 baud
BAUD300 300 baud
BAUD600 600 baud
BAUD1200 1200 baud
BAUD2400 2400 baud
BAUD4800 4800 baud
BAUD9600 9600 baud
BAUD14400 14400 baud
BAUD19200 19200 baud
BAUD28800 28800 baud
BAUD38400 38400 baud
BAUD57600 57600 baud
BAUD115200 115200 baud

On Exit-

int stat;

This function returns one of the COMM-DRV/LIB errors. The error codes are defined in Appendix C (Returns RS232ERR_NONE if successful).

See Also-



#include “comm.h”

int port=0;
int stat;

if ((stat = SetBaud(port,BAUD57600)) != RS232ERR_NONE)
printf(“Port not initialized\n”);

/* Take remedial action */