From a5ae20daff0692a93cc1390c64bc9bb5e26e77fe Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sun, 6 May 2012 23:37:28 +0200 Subject: [PATCH] Force serial to non-blocking. --- tools/mesh/lib/r0ket.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/mesh/lib/r0ket.pm b/tools/mesh/lib/r0ket.pm index 86e5c95..62741fb 100755 --- a/tools/mesh/lib/r0ket.pm +++ b/tools/mesh/lib/r0ket.pm @@ -8,7 +8,7 @@ use IO::Select; package r0ket; use Digest::CRC qw(crcccitt); -use POSIX qw(strftime); +use POSIX qw(strftime VTIME VMIN TCSANOW); use Time::HiRes; our $verbose=0; @@ -328,6 +328,14 @@ sub r0ket_init{ if($verbose){ print "using: $ser\n"; }; + + # Set serial to non-blocking: + my ($term)=POSIX::Termios->new(); + $term->getattr(fileno($bridge)); + $term->setcc(VTIME,1); + $term->setcc(VMIN,0); + $term->setattr(fileno($bridge),TCSANOW); + return $ser; };