send_break
author A.M. Thurnherr <ant@ldeo.columbia.edu>
Fri, 07 Jan 2011 23:10:30 +0000
changeset 7 0373c17d8b57
parent 0 648bde652211
permissions -rwxr-xr-x
modified libRDI.expect to reliably wake up both instruments by making sure slave is woken up first

#!/usr/local/bin/perl
#======================================================================
#                    S E N D _ B R E A K 
#                    doc: Tue Aug  8 13:58:51 2006
#                    dlm: Tue Aug  8 19:41:01 2006
#                    (c) 2006 turbulence@
#                    uE-Info: 30 19 NIL 0 0 72 10 2 8 NIL ofnI
#======================================================================

# read from tty, write to stdout

# HISTORY:
#  Aug  8, 2006: - created from [bbabble] on DYNAMUCK cruise

use POSIX ();

$USAGE = "Usage: $0 <tty device>\n";
die($USAGE) unless (@ARGV == 1);
$TTY = $ARGV[0];

print(STDERR "Opening $TTY...");
my($sfd);
open(TTY,$TTY) || die(" $!\n");
$sfd = fileno(TTY);
print(STDERR "\n");

print(STDERR "Sending BREAK...");
die(" tcsendbreak: $!\n")
    unless defined(POSIX::tcsendbreak($sfd,0));
print(STDERR "\n");

exit(0);