2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

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
This commit is contained in:
martinp876 2013-12-09 18:28:40 +00:00
parent 941c8d45ee
commit 5280a37858
3 changed files with 40 additions and 4 deletions

View File

@ -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);
}

View File

@ -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.

View File

@ -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;