From 5280a37858a790d5b23c93bb540dbe760cb98af2 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Mon, 9 Dec 2013 18:28:40 +0000 Subject: [PATCH] hmlan wait, CUL_HM set burst on peerChan - correct notification, HMinfo check burst setting git-svn-id: https://svn.fhem.de/fhem/trunk@4350 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_HMLAN.pm | 2 +- fhem/FHEM/10_CUL_HM.pm | 6 ++++-- fhem/FHEM/98_HMinfo.pm | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/00_HMLAN.pm b/fhem/FHEM/00_HMLAN.pm index f72fced9f..d63c14486 100755 --- a/fhem/FHEM/00_HMLAN.pm +++ b/fhem/FHEM/00_HMLAN.pm @@ -601,7 +601,7 @@ sub HMLAN_Parse($$) {########################################################## # HMLAN sends ACK for flag 'A0' but not for 'A4'(config mode)- # we ack ourself an long as logic is uncertain - also possible is 'A6' for RHS - if (hex($flg)&0x02){#not sure: 4 oder 2 ? 02 works for VD! + if (hex($flg)&0x22){#not sure: 4 oder 2 ? 0x.2 works for VD! my $wait = 0.100 - $dly/1000; $hash->{helper}{$src}{nextSend} = gettimeofday() + $wait if ($wait > 0); } diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index a9d8458e1..50abcf2bf 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -3296,8 +3296,10 @@ sub CUL_HM_Set($@) { my $peerFlag = CUL_HM_getFlag($peerHash); CUL_HM_PushCmdStack($peerHash, sprintf("++%s01%s%s%s%s%s%02X%02X", $peerFlag,$id,$peerDst,$peerChn,$cmdB,$dst,$b2,$b1 )); - CUL_HM_pushConfig($peerHash,$id,$peerDst,0,0,0,0,"0101")#set burstRx - if(CUL_HM_getRxType($peerHash) & 0x80); #burstConditional + if(CUL_HM_getRxType($peerHash) & 0x80){ + my $pDevHash = CUL_HM_id2Hash($peerDst);#put on device + CUL_HM_pushConfig($pDevHash,$id,$peerDst,0,0,0,0,"0101");#set burstRx + } CUL_HM_qAutoRead($peerHash->{NAME},3); } $devHash = $peerHash; # Exchange the hash, as the switch is always alive. diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index 68fe38b50..212d985d3 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -201,6 +201,39 @@ sub HMinfo_peerCheck(@) { ##################################################### ."\n\n peer not verified " ."\n ".(join "\n ",sort @peerIDsNoPeer) ; } +sub HMinfo_burstCheck(@) { ##################################################### + my @entities = @_; + my @peerIDsNeed; + my @peerIDsCond; + my %th = CUL_HM_putHash("culHmModel"); + foreach my $eName (@entities){ + next if (!$defs{$eName}{helper}{role}{chn});#device has no channels + next if (!CUL_HM_peerUsed($eName)); + next if (CUL_HM_Get($defs{$eName},$eName,"regList") !~ m/peerNeedsBurst/); + + my $peerIDs = AttrVal($eName,"peerIDs",undef); + next if(!$peerIDs); # no peers - noting to check + + my $devId = substr($defs{$eName}{DEF},0,6); + foreach (split",",$peerIDs){ + next if ($_ eq "00000000" ||$_ =~m /$devId/); + my $pn = CUL_HM_id2Name($_); + $pn =~ s/_chn:/_chn-/; + my $prxt = CUL_HM_getRxType($defs{$pn}); + + next if (!($prxt & 0x82)); # not a burst peer + push @peerIDsNeed," $eName for peer $pn" if (ReadingsVal($eName,"R-$pn-peerNeedsBurst","") !~ m /on/); + if ($prxt & 0x80){# conditional burst - is it on? + my $pDevN = CUL_HM_getDeviceName($pn); + push @peerIDsCond," $pDevN for remote $eName" if (ReadingsVal($pDevN,"R-burstRx","") !~ m /on/); + } + } + } + return "\n\n peerNeedsBurst not set" ."\n ".(join "\n ",sort @peerIDsNeed) + ."\n\n conditionalBurst not set"."\n ".(join "\n ",sort @peerIDsCond) + ; +} + sub HMinfo_getEntities(@) { ################################################### my ($filter,$re) = @_; my @names; @@ -505,7 +538,8 @@ sub HMinfo_SetFn($@) {######################################################### elsif($cmd eq "configCheck"){##check peers and register---------------------- my @entities = HMinfo_getEntities($opt."v",$filter); $ret = $cmd." done:" .HMinfo_regCheck(@entities) - .HMinfo_peerCheck(@entities); + .HMinfo_peerCheck(@entities) + .HMinfo_burstCheck(@entities); } elsif($cmd eq "peerXref") {##print cross-references------------------------ my @peerPairs;