2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 07:16:03 +00:00

verify short and long delays in transmission

git-svn-id: https://svn.fhem.de/fhem/trunk@6279 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-07-20 06:28:10 +00:00
parent 5173ad100d
commit 964bf46a80
2 changed files with 15 additions and 15 deletions

View File

@ -900,19 +900,19 @@ sub HMLAN_qResp($$$) {#response-waiting queue##################################
$hashQ->{answerPend} ++;
push @{$hashQ->{apIDs}},$id;
if ($hashQ->{answerPend} >= $hashQ->{hmLanQlen}){
$hash->{XmitOpen} = 0;
$hash->{XmitOpen} = 2;#delay further sending
InternalTimer(gettimeofday()+10, "HMLAN_clearQ", "hmClearQ:$hash->{NAME}", 0);
}
}
else{
$hashQ->{answerPend}-- if ($hashQ->{answerPend}>0);
@{$hashQ->{apIDs}}=grep !/$id/,@{$hashQ->{apIDs}};
RemoveInternalTimer("hmClearQ:$hash->{NAME}")if ($hash->{XmitOpen} ==0);
$hash->{XmitOpen} = 1
if (($hashQ->{answerPend} < $hashQ->{hmLanQlen}) &&
!($hashQ->{HMcndN} == 4 ||
$hashQ->{HMcndN} == 253)
);
RemoveInternalTimer("hmClearQ:$hash->{NAME}")if ($hash->{XmitOpen} == 0);
if ($hashQ->{HMcndN} == 4 ||
$hashQ->{HMcndN} == 253){ $hash->{XmitOpen} = 0;}
elsif($hashQ->{answerPend} >= $hashQ->{hmLanQlen}){$hash->{XmitOpen} = 2;}
else{ $hash->{XmitOpen} = 1;}
}
}
sub HMLAN_clearQ($) {#clear pending acks due to timeout########################
@ -932,8 +932,9 @@ sub HMLAN_condUpdate($$) {#####################################################
my $name = $hash->{NAME};
my $hashCnd = $hash->{helper}{cnd};#short to helper
my $hashQ = $hash->{helper}{q};#short to helper
$hashCnd->{$HMcnd} = 0 if (!$hashCnd->{$HMcnd});
$hashCnd->{$HMcnd}++;
$hash->{helper}{cnd}{$HMcnd} = 0 if (!$hash->{helper}{cnd} ||
!$hash->{helper}{cnd}{$HMcnd});
$hash->{helper}{cnd}{$HMcnd}++;
if ($HMcnd == 4){#HMLAN needs a rest. Supress all sends exept keep alive
$hash->{STATE} = "overload";
}
@ -945,8 +946,8 @@ sub HMLAN_condUpdate($$) {#####################################################
my $HMcndTxt = $HMcond{$HMcnd}?$HMcond{$HMcnd}:"Unknown:$HMcnd";
Log3 $hash, 1, "HMLAN_Parse: $name new condition $HMcndTxt";
my $txt;
$txt .= $HMcond{$_}.":".$hashCnd->{$_}." "
foreach (keys%{$hashCnd});
$txt .= $HMcond{$_}.":".$hash->{helper}{cnd}{$_}." "
foreach (keys%{$hash->{helper}{cnd}});
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"cond",$HMcndTxt);
@ -970,8 +971,7 @@ sub HMLAN_condUpdate($$) {#####################################################
$hash->{XmitOpen} = 0; #deny transmit
}
else{
$hash->{XmitOpen} = 1
if($hashQ->{answerPend} < $hashQ->{hmLanQlen});#allow transmit
$hash->{XmitOpen} = ($hashQ->{answerPend} < $hashQ->{hmLanQlen})?"1":"2";#allow transmit
}
readingsEndUpdate($hash,1);
my $ccu = InternalVal($name,"owner_CCU","");

View File

@ -4835,7 +4835,7 @@ sub CUL_HM_sndIfOpen($) {
RemoveInternalTimer("sndIfOpen:$io");# should not be necessary, but
my $ioHash = $defs{$io};
if ( $ioHash->{STATE} !~ m/^(opened|Initialized)$/
||(defined $ioHash->{XmitOpen} && $ioHash->{XmitOpen} == 0)
||(defined $ioHash->{XmitOpen} && $ioHash->{XmitOpen} != 1)
# ||$modules{CUL_HM}{prot}{rspPend}>=$maxPendCmds
){#still no send allowed
if ($modules{CUL_HM}{$io}{tmrStart} < gettimeofday() - $modules{CUL_HM}{hmIoMaxDly}){
@ -4881,7 +4881,7 @@ sub CUL_HM_SndCmd($$) {
if ( $io->{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} == 0)#overload, dont send
||(defined $io->{XmitOpen} && $io->{XmitOpen} != 1)#overload, dont send
)
){