diff options
author | 2012-07-15 06:55:28 +0000 | |
---|---|---|
committer | 2012-07-15 06:55:28 +0000 | |
commit | beec8f30410f0780e1fabcaed71eb927b96ce640 (patch) | |
tree | eb59d8b9d0884fda16905296c5dca0872a2af11f /usr.bin/cu/command.c | |
parent | Document pane_index variable, from sam at sltosis dot org. (diff) | |
download | wireguard-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.
Diffstat (limited to 'usr.bin/cu/command.c')
-rw-r--r-- | usr.bin/cu/command.c | 8 |
1 files changed, 7 insertions, 1 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" |