summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-06-04 19:22:50 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-06-04 19:55:12 +0200
commit818bc81584b0e2ca3fc335e10a7fc27d0cb36f85 (patch)
tree754634b74258ab51b7edde90df7244846049e7df
parent63e6314777f161fc71117424b8dd65df98fc6a6d (diff)
downloadmicrocom-818bc81584b0e2ca3fc335e10a7fc27d0cb36f85.tar.gz
microcom-818bc81584b0e2ca3fc335e10a7fc27d0cb36f85.tar.xz
commands: Implement a command to send the escape char
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Closes: https://github.com/pengutronix/microcom/issues/35
-rw-r--r--commands.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/commands.c b/commands.c
index ed1b8f0..9345eba 100644
--- a/commands.c
+++ b/commands.c
@@ -153,6 +153,12 @@ static int cmd_quit(int argc, char *argv[])
return 0;
}
+static int cmd_sendescape(int argc, char *argv[])
+{
+ ios->write(ios, "\x1c", 1);
+ return 0;
+}
+
static int cmd_help(int argc, char *argv[])
{
struct cmd *cmd;
@@ -226,6 +232,10 @@ static struct cmd cmds[] = {
.fn = cmd_break,
.info = "send break",
}, {
+ .name = "sendescape",
+ .fn = cmd_sendescape,
+ .info = "send a Ctrl-\\",
+ }, {
.name = "quit",
.fn = cmd_quit,
.info = "quit microcom",