2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-15 16:19:11 +00:00

10_CUL_HM: get IOstate from Reading, not Internals

git-svn-id: https://svn.fhem.de/fhem/trunk@8787 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2015-06-20 23:18:22 +00:00
parent 69b5a826d6
commit 86a0e3ee63

View File

@ -5604,7 +5604,7 @@ sub CUL_HM_sndIfOpen($) {
my(undef,$io) = split(':',$_[0]);
RemoveInternalTimer("sndIfOpen:$io");# should not be necessary, but
my $ioHash = $defs{$io};
if ( $ioHash->{STATE} !~ m/^(opened|Initialized)$/
if ( ReadingsVal($io,"state","") !~ m/^(opened|Initialized)$/
||(defined $ioHash->{XmitOpen} && $ioHash->{XmitOpen} != 1)
# ||$modules{CUL_HM}{prot}{rspPend}>=$maxPendCmds
){#still no send allowed
@ -5656,7 +5656,7 @@ sub CUL_HM_SndCmd($$) {
my $io = $hash->{IODev};
my $ioName = $io->{NAME};
if ( $io->{STATE} !~ m/^(opened|Initialized)$/ # we need to queue
if ( ReadingsVal($ioName,"state","") !~ m/^(opened|Initialized)$/ # we need to queue
||(hex substr($cmd,2,2) & 0x20) && ( # check for commands with resp-req
$modules{CUL_HM}{$ioName}{tmr} # queue already running
||(defined $io->{XmitOpen} && $io->{XmitOpen} != 1)#overload, dont send
@ -5800,7 +5800,7 @@ sub CUL_HM_respPendTout($) {
CUL_HM_respPendRm($hash);# do not count problems with wakeup try, just wait
CUL_HM_protState($hash,"CMDs_pending");
}
elsif ($hash->{IODev}->{STATE} !~ m/^(opened|Initialized)$/){#IO errors
elsif (ReadingsVal($hash->{IODev},"state","") !~ m/^(opened|Initialized)$/){#IO errors
CUL_HM_eventP($hash,"IOdly");
CUL_HM_ProcessCmdStack($hash) if($rxt & 0x03);#burst/all
}
@ -7464,7 +7464,7 @@ sub CUL_HM_assignIO($){ #check and assign IO
unshift @ios,@{$hash->{helper}{io}{prefIO}} if ($hash->{helper}{io}{prefIO});# set prefIO to first choice
foreach my $iom (@ios){
if ( !$defs{$iom}
|| $defs{$iom}{STATE} eq "disconnected"
|| ReadingsVal($iom,"state","") eq "disconnected"
|| InternalVal($iom,"XmitOpen",1) == 0){# HMLAN/HMUSB?
next;
}