summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-07-15 06:55:28 +0000
committernicm <nicm@openbsd.org>2012-07-15 06:55:28 +0000
commitbeec8f30410f0780e1fabcaed71eb927b96ce640 (patch)
treeeb59d8b9d0884fda16905296c5dca0872a2af11f
parentDocument pane_index variable, from sam at sltosis dot org. (diff)
downloadwireguard-openbsd-beec8f30410f0780e1fabcaed71eb927b96ce640.tar.xz
wireguard-openbsd-beec8f30410f0780e1fabcaed71eb927b96ce640.zip
Add a command (~D) to drop the DTR line for a second (similar to using
~# for a BREAK). This is useful as it makes some microcontroller boards reset. From Visa Hankala.
-rw-r--r--usr.bin/cu/command.c8
-rw-r--r--usr.bin/cu/cu.16
2 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/cu/command.c b/usr.bin/cu/command.c
index 17d86655eb6..54e6490ca19 100644
--- a/usr.bin/cu/command.c
+++ b/usr.bin/cu/command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: command.c,v 1.11 2012/07/11 16:45:12 nicm Exp $ */
+/* $OpenBSD: command.c,v 1.12 2012/07/15 06:55:28 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org>
@@ -229,6 +229,11 @@ do_command(char c)
case 'C':
connect_command();
break;
+ case 'D':
+ ioctl(line_fd, TIOCCDTR, NULL);
+ sleep(1);
+ ioctl(line_fd, TIOCSDTR, NULL);
+ break;
case 'R':
start_record();
break;
@@ -258,6 +263,7 @@ do_command(char c)
"~$ pipe local command to remote host\r\n"
"~> send file to remote host\r\n"
"~C connect program to remote host\r\n"
+ "~D de-assert DTR line briefly\r\n"
"~R start recording to file\r\n"
"~S set speed\r\n"
"~X send file with XMODEM\r\n"
diff --git a/usr.bin/cu/cu.1 b/usr.bin/cu/cu.1
index c3ad41157a4..8dee23b972e 100644
--- a/usr.bin/cu/cu.1
+++ b/usr.bin/cu/cu.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cu.1,v 1.6 2012/07/12 13:11:46 nicm Exp $
+.\" $OpenBSD: cu.1,v 1.7 2012/07/15 06:55:28 nicm Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)tip.1 8.4 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: July 12 2012 $
+.Dd $Mdocdate: July 15 2012 $
.Dt CU 1
.Os
.Sh NAME
@@ -123,6 +123,8 @@ file descriptors:
1 \*(Lt-\*(Gt remote tty out
2 \*(Lt-\*(Gt local tty stderr
.Ed
+.It Ic ~D
+Deassert the data terminal ready (DTR) line briefly.
.It Ic ~R
Record all output from the remote system to a file.
If the given file already exists, it is appended to.