409e2f3701
The TERMIOS(3) function tcsendbreak() and the IOCTLs TCSBRK and TCSBRKP transmit a serial line Break. Previously NuttX included an extern declaration for tcsendbreak() and defines for TCSBRK and TCSBRKP but none of these were implemented. Attempting to build programs that called tcsendbreak() would fail with a linker error; attempting to use TCSBRK and TCSBRKP would result in an error at runtime. This changeset adds the tcsendbreak() function and handling for TCSBRK and TCSBRKP; tcsendbreak() is implemented in terms of TCSBRK. Both TCSBRK and TCSBRKP are implemented in terms of the BSD-compatible Break IOCTLs TIOCSBRK and TIOCCBRK, which must be provided by the lower half serial driver. Currently, not all lower half serial drivers in NuttX support these IOCTLs. Those that do implement them may need one or more Kconfig options to be set, such as `CONFIG_*_U[S]ART_BREAKS` and, on some architectures, a separate `CONFIG_*_SERIALBRK_BSDCOMPAT`. * drivers/serial/serial.c (uart_tcsendbreak): New function. (uart_ioctl): Implement TCSBRK and TCSBRKP. * libs/libc/termios/lib_tcsendbreak.c (): New file. * libs/libc/termios/Make.defs (CSRCS): Add lib_tcsendbreak.c to the build. Thanks to Xiang Xiao for PR feedback. Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com> |
||
---|---|---|
.. | ||
Kconfig | ||
Kconfig-16550 | ||
Kconfig-lpuart | ||
Kconfig-sci | ||
Kconfig-uart | ||
Kconfig-usart | ||
Make.defs | ||
ptmx.c | ||
pty.c | ||
pty.h | ||
serial_dma.c | ||
serial_io.c | ||
serial.c | ||
uart_16550.c | ||
uart_bth4.c | ||
uart_rpmsg.c |