2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 12:58:13 +00:00

DevIo.pm: add use strict, and fix warnings (Forum #110125)

git-svn-id: https://svn.fhem.de/fhem/trunk@21655 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-04-13 06:48:56 +00:00
parent 5bcfb9101a
commit 1c11a2cb70

View File

@ -2,6 +2,9 @@
# $Id$
package main;
use strict;
use warnings;
sub DevIo_CloseDev($@);
sub DevIo_Disconnected($);
sub DevIo_Expect($$$);
@ -113,9 +116,9 @@ DevIo_TimeoutRead($$;$$)
my $nfound = select($rin, undef, undef, $timeout);
last if($nfound <= 0); # timeout
my $r = DevIo_DoSimpleRead($hash);
last if(!defined($r) || ($r == "" && $hash->{TCPDev}));
last if(!defined($r) || ($r eq "" && $hash->{TCPDev}));
$answer .= $r;
last if(length($anser) >= $maxlen || ($regexp && $answer =~ m/$regexp/));
last if(length($answer) >= $maxlen || ($regexp && $answer =~ m/$regexp/));
}
return $answer;
}
@ -271,6 +274,7 @@ DevIo_OpenDev($$$;$)
return undef;
};
$baudrate = "" if(!defined($baudrate));
if($baudrate =~ m/(\d+)(,([78])(,([NEO])(,([012]))?)?)?/) {
$baudrate = $1 if(defined($1));
$databits = $3 if(defined($3));