CFSPEED(S) UNIX System V CFSPEED(S)
Name
cfspeed: cfgetispeed, cfgetospeed, cfsetispeed, cfsetospeed
- baud rate functions
Syntax
#include <termios.h>
speed_t cfgetospeed (termios_p)
struct termios *termios_p;
int cfsetospeed (termios_p, speed)
struct termios *termios_p;
speed_t speed;
speed_t cfgetispeed (termios_p)
struct termios *termios_p;
int cfsetispeed (termios_p, speed)
struct termios *termios_p;
speed_t speed;
Description
The following interfaces are provided for getting and
setting the values of the input and output baud rates in the
termios structure. The effects on the terminal device
described below do not become effective until the
tcsetattr() function is called successfully.
The input and output baud rates are stored in the termios
structure. The values shown in the following table are
supported. The name symbols in this table are defined in
<termios.h>.
Name Description Name Description
__________________________________________
BO Hang up B600 600 baud
B50 50 baud B1200 1200 baud
B75 75 baud B1800 1800 baud
B110 110 baud B2400 2400 baud
B134 134.5 baud B4800 4800 baud
B150 150 baud B9600 9600baud
B200 200 baud B19200 19200 baud
B300 300 baud B38400 38400 baud
The type speed_t shall be defined in <termios.h> and shall
be an unsigned integral type.
The termios_p argument is a pointer to a termios structure.
cfgetospeed() returns the output baud rate stored in the
termios structure pointed to by termios_p.
cfsetospeed() sets the output baud rate stored in the
termios structure pointed to by termios_p to speed. The
zero baud rate, BO, is used to terminate the connection. If
BO is specified, the modem control lines are no longer
asserted. Normally, this will disconnect the line.
cfgetispeed() returns the input baud rate stored in the
termios structure.
cfsetispeed() sets the input baud rate stored in the termios
structure to speed. If the input baud rate is set to zero,
the input baud rate will be specified by the value of the
ouput baud rate. Both cfsetispeed() and cfsetospeed()
return a value of zero if successful and -1 to indicate an
error. Attempts to set unsupported baud rates are ignored,
and it is implementation-defined whether an error is
returned by any or all of cfsetispeed(), cfsetospeed(), or
tcsetattr(). This refers both to changes to baud rates not
supported by the hardware, and to changes setting the input
and output baud rates to different values if the hardware
does not support this.
Standards Conformance
cfgetispeed, cfgetospeed, cfsetispeed and cfsetospeed are
conformant with:
IEEE POSIX Std 1003.1-1988 with C Standard Language-
Dependent System Support;
and NIST FIPS 151-1.
(printed 6/20/89)