MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / cfsetospeed

Function cfsetospeed

components/libc/posix/io/termios/termios.c:136–147  ·  view source on GitHub ↗

* @brief Sets the output baud rate in a termios structure. * @param tio Pointer to a struct termios where the output baud rate will be set. * @param speed Output baud rate to be set. * @return Upon successful completion, returns 0; otherwise, returns -1 and sets errno to indicate the error. * * @note This function sets the output baud rate in the termios structure pointed to by tio.

Source from the content-addressed store, hash-verified

134 * and sets them to the specified speed value. It then returns 0 to indicate success.
135 */
136int cfsetospeed(struct termios *tio, speed_t speed)
137{
138 if (speed & ~CBAUD)
139 {
140 errno = EINVAL;
141 return -1;
142 }
143
144 tio->c_cflag &= ~CBAUD;
145 tio->c_cflag |= speed;
146 return 0;
147}
148
149/**
150 * @brief Sets the input baud rate in a termios structure.

Callers 8

lwp_tty_ioctl_adapterFunction · 0.85
rt_serial_controlFunction · 0.85
rt_serial_controlFunction · 0.85
configureSerialFunction · 0.85
configureSerialFunction · 0.85
cfsetispeedFunction · 0.85
cfsetspeedFunction · 0.85
config_commFunction · 0.85

Calls

no outgoing calls

Tested by 1

config_commFunction · 0.68