From 148ae53cf8d3abc2c2e11c94c171b123b950b2fc Mon Sep 17 00:00:00 2001 From: Tennn11 <88527847+Tennn11@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:01:16 +0800 Subject: [PATCH] [tty] add TCGETA/TCSETAF/TCSETAW/TCSETA commands (#7739) --- components/drivers/tty/tty_ioctl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/drivers/tty/tty_ioctl.c b/components/drivers/tty/tty_ioctl.c index e1982ee3ea..4a537f2e53 100644 --- a/components/drivers/tty/tty_ioctl.c +++ b/components/drivers/tty/tty_ioctl.c @@ -80,6 +80,7 @@ int n_tty_ioctl_extend(struct tty_struct *tty, int cmd, void *args) switch(cmd) { case TCGETS: + case TCGETA: { struct termios *tio = (struct termios *)p; if (tio == RT_NULL) @@ -102,6 +103,18 @@ int n_tty_ioctl_extend(struct tty_struct *tty, int cmd, void *args) { return set_termios(real_tty, p, TERMIOS_OLD); } + case TCSETAF: + { + return set_termios(real_tty, p, TERMIOS_FLUSH | TERMIOS_WAIT | TERMIOS_TERMIO); + } + case TCSETAW: + { + return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO); + } + case TCSETA: + { + return set_termios(real_tty, p, TERMIOS_TERMIO); + } default: break; }