allow resend for burst devices if fhemWeb causes delay

git-svn-id: https://svn.fhem.de/fhem/trunk@5952 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876
2014-05-24 09:48:01 +00:00
parent fcfd8b1ee7
commit 67eaee8856
2 changed files with 19 additions and 3 deletions

View File

@@ -2544,7 +2544,7 @@ sub CUL_HM_pushEvnts(){########################################################
sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
my ($hash, @a) = @_;
return "no value specified" if(@a < 2);
return "" if(!$hash->{NAME});
my $name = $hash->{NAME};
my $devName = InternalVal($name,"device",$name);
my $st = AttrVal($devName, "subType", "");
@@ -4866,6 +4866,7 @@ sub CUL_HM_respPendTout($) {
elsif ($pHash->{rspWait}{reSent} > AttrVal($name,"msgRepeat",3)#too many
||(!($rxt & 0x9B))){#config cannot retry
my $pendCmd = "MISSING ACK";
if ($pHash->{rspWait}{Pending}){
$pendCmd = "RESPONSE TIMEOUT:".$pHash->{rspWait}{Pending};
CUL_HM_complConfig($name);
@@ -4903,6 +4904,17 @@ sub CUL_HM_respPendTout($) {
}
else{# normal device resend
if ($rxt & 0x02){# type = burst - need to set burst-Bit for retry
if ($pHash->{mmcA}){#fillback multi-message command
unshift @{$hash->{cmdStack}},$_ foreach (reverse@{$pHash->{mmcA}});
delete $pHash->{mmcA};
delete $pHash->{mmcS};
my $cmd = shift @{$hash->{cmdStack}};
$cmd = sprintf("As%02X01%s", length($cmd)/2, substr($cmd,2));
$pHash->{rspWait}{cmd} = $cmd;
CUL_HM_responseSetup($hash,$cmd);
}
my ($pre,$tp,$tail) = unpack 'A6A2A*',$pHash->{rspWait}{cmd};
$pHash->{rspWait}{cmd} = sprintf("%s%02X%s",$pre,(hex($tp)|0x10),$tail);
}
@@ -6255,8 +6267,12 @@ sub CUL_HM_storeRssi(@){
return if (!$val);
if (AttrVal($peerName,"subType","") eq "virtual"){
my $h = InternalVal($name,"IODev","");#CUL_HM_name2IoName($peerName);
return if (!$h);
$peerName = $h->{NAME};
}
else{
return if (length($peerName)<3);
}
my ($mVal,$mPn) = ($val,substr($peerName,3));
if ($defs{$name}{helper}{mRssi}{mNo} ne $mNo){# new message

View File

@@ -705,7 +705,8 @@ sub HMinfo_getEntities(@) { ###################################################
next if ($id eq "000000");
my $eHash = $modules{CUL_HM}{defptr}{$id};
my $eName = $eHash->{NAME};
my $isChn = (length($id) != 6 || CUL_HM_Get($eHash,$eName,"param","channel_01") eq "undefined")?1:0;
next if ( !$eName || $eName !~ m/$re/);
my $isChn = $eHash->{helper}{chn}?1:0;
my $eIg = CUL_HM_Get($eHash,$eName,"param","ignore");
$eIg = "" if ($eIg eq "undefined");
next if (!(($doDev && length($id) == 6) ||
@@ -717,7 +718,6 @@ sub HMinfo_getEntities(@) { ###################################################
next if ( $noSen && $eSt =~ m/^(THSensor|remote|pushButton|threeStateSensor|sensor|motionDetector|swi)$/);
next if ( $noAct && $eSt =~ m/^(switch|blindActuator|dimmer|thermostat|smokeDetector|KFM100|outputUnit)$/);
next if ( $eName !~ m/$re/);
push @names,$eName;
}
return sort(@names);