yangsong8-a1 opened a new pull request, #22104:
URL: https://github.com/apache/nuttx/pull/22104
## Summary
Follow-up to #21839. The termios helpers keep c_iflag, c_oflag,
c_lflag and the INTR/SUSP characters in struct uart_termios_s, but
serial keeps VMIN and VTIME in its own minread/timeout fields and pty
does not keep them at all.
- struct uart_termios_s also keeps c_cc[VMIN] and c_cc[VTIME] with
CONFIG_SERIAL_TERMIOS, and uart_termios_getattr()/setattr() copy them.
- uart_termios_init() replaces uart_termios_initcc() and sets every
field of the state (flags, INTR/SUSP, VMIN 1, VTIME 0). serial and
pty set up their terminal with it.
- serial drops minread/timeout and reads the values from the termios
state; pty now gives back the VMIN and VTIME that were set (it still
does not act on them).
## Impact
drivers/serial (serial.c, pty.c, serial_termios.c) and
include/nuttx/serial/serial.h. uart_termios_initcc() is replaced by
uart_termios_init(); it has no users outside these files. The only
visible change is that TCGETS on a pty returns the VMIN/VTIME set by
TCSETS instead of always 1/0.
## Testing
Ubuntu 22.04, gcc 13.1, sim:nsh with CONFIG_SERIAL_TERMIOS,
CONFIG_TTY_SIGINT(_CHAR=0x03), CONFIG_TTY_SIGTSTP(_CHAR=0x1a),
CONFIG_PSEUDOTERM and CONFIG_PSEUDOTERM_SUSV1; no warnings in the
touched files.
The termios test used for #21839 (57 cases: getattr/setattr of c_cc,
runtime INTR/SUSP, _POSIX_VDISABLE, pty master/slave, signals from the
host) gives identical results on master and with this PR, with
CONFIG_SIM_UART_DMA=y and =n.
VMIN/VTIME test:
master:
CASE ptyinit slave min=1 time=0
CASE ptyset ret=0
CASE ptyslave min=1 time=0
CASE ptymaster min=1 time=0
CASE ttyinit min=1 time=0
CASE ttyset min=0 time=5
CASE ttyread n=-1 ms=400-900
This PR:
CASE ptyinit slave min=1 time=0
CASE ptyset ret=0
CASE ptyslave min=5 time=7
CASE ptymaster min=5 time=7
CASE ttyinit min=1 time=0
CASE ttyset min=0 time=5
CASE ttyread n=-1 ms=400-900
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]