Hardware Reference
In-Depth Information
cfsetispeed(3)
The
cfsetispeed(3)
function permits a portable way to establish an input baud rate in
the
termios
structure:
int cfsetispeed(struct termios
*
termios_p, speed_t speed);
where
termios_p
is the pointer to the TTY configuration structure to be modified.
speed
is the input baud rate to apply.
Note that this function only updates the
termios
data structure and has no direct
effect on the device being used.
struct termios term;
int rc;
rc = cfsetispeed(&term,115200);
if ( rc < 0 ) {
perror("cfsetispeed(3)");
cfsetospeed(3)
The
cfsetospeed(3)
function sets the output baud rate in the
termios
structure:
int cfsetospeed(struct termios
*
termios_p, speed_t speed);
where
termios_p
is the pointer to the TTY configuration structure being modified.
speed
is the output baud rate to apply.
Note that this function only updates the
termios
data structure with no direct effect
on the device being used.
struct termios term;
int rc;
rc = cfsetospeed(&term,9600);
if ( rc < 0 ) {
perror("cfsetospeed(3)");