projects
/
safeq
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea92087
)
ask for response on unknown
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 22 Feb 2019 08:51:16 +0000
(09:51 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 22 Feb 2019 08:51:16 +0000
(09:51 +0100)
terminal-emulator.pl
patch
|
blob
|
history
diff --git
a/terminal-emulator.pl
b/terminal-emulator.pl
index
9a4b485
..
781d353
100755
(executable)
--- a/
terminal-emulator.pl
+++ b/
terminal-emulator.pl
@@
-34,22
+34,21
@@
my @send_receive = grep { /^.+$/ } split(/\n/, q{
.ACTION CMENUS0
.NOP
.ACTION CMENUS0
.NOP
-.NOP
-
+.NOP
.NOP
.NOP
-.NOP
+.NOP
.NOP
.NOP
-.NOP
+.NOP
.NOP
.NOP
-.NOP
+.NOP
.NOP
.NOP
.NOP
.NOP
-.END
+.END
});
#warn "# send_receive=",dump( \@send_receive );
});
#warn "# send_receive=",dump( \@send_receive );
@@
-61,9
+60,15
@@
while ( @send_receive ) {
print $socket "$send\r\n";
my $got = <$socket>;
$got =~ s/[\r\n]+$//;
print $socket "$send\r\n";
my $got = <$socket>;
$got =~ s/[\r\n]+$//;
-warn dump($send,$expect,$got);
+warn
"# send/expect/got ",
dump($send,$expect,$got);
warn "<< $got\n";
warn "<< $got\n";
- die "ERROR expected [$expect] got [$got]" if $expect ne $got;
+ if ( $expect ne $got ) {
+ warn "ERROR expected [$expect] got [$got]\n";
+ print "Response>";
+ my $r = <STDIN>; chomp $r;
+ print $socket "$r\r\n";
+ }
+
}
$socket->close();
}
$socket->close();