mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
CUL_HM:debug peer handling
git-svn-id: https://svn.fhem.de/fhem/trunk@23742 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
45e9953ec1
commit
d681ccdc99
@ -6326,7 +6326,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
$peer = ".*" if ($peer eq "all");
|
$peer = ".*" if ($peer eq "all");
|
||||||
my @peerLchn = map{CUL_HM_name2Id($_)}
|
my @peerLchn = map{CUL_HM_name2Id($_)}
|
||||||
grep/$peer/,
|
grep/$peer/,
|
||||||
CUL_HM_getPeers($name,"Names");
|
CUL_HM_getPeers($name,"IDs");
|
||||||
my @peerList = grep !/000000/,grep !/^$/
|
my @peerList = grep !/000000/,grep !/^$/
|
||||||
,CUL_HM_noDup(map{substr($_,0,6)} @peerLchn); # peer device IDs - clean
|
,CUL_HM_noDup(map{substr($_,0,6)} @peerLchn); # peer device IDs - clean
|
||||||
|
|
||||||
@ -6396,7 +6396,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
return "condition $a[3] out of range. limit to 0..255" if ($a[3]<0 || $a[3]>255);
|
return "condition $a[3] out of range. limit to 0..255" if ($a[3]<0 || $a[3]>255);
|
||||||
}
|
}
|
||||||
my @peers = ();
|
my @peers = ();
|
||||||
foreach my $peerItem (grep/$peer/,CUL_HM_getPeers($name,"Names")){
|
foreach my $peerItem (grep/$peer/,CUL_HM_getPeers($name,"NamesExt")){
|
||||||
if ($defs{$peerItem}{helper}{role}{vrt}){
|
if ($defs{$peerItem}{helper}{role}{vrt}){
|
||||||
}
|
}
|
||||||
elsif($defs{$peerItem}{helper}{role}{chn}){
|
elsif($defs{$peerItem}{helper}{role}{chn}){
|
||||||
@ -8164,7 +8164,6 @@ sub CUL_HM_ID2PeerList ($$$) { # {CUL_HM_ID2PeerList ("lvFrei","12345678",1)}
|
|||||||
my $md = AttrVal($dHash->{NAME},"model","");
|
my $md = AttrVal($dHash->{NAME},"model","");
|
||||||
my $chn = InternalVal($name,"chanNo","");
|
my $chn = InternalVal($name,"chanNo","");
|
||||||
if ($peerNames && $peerNames ne " "){
|
if ($peerNames && $peerNames ne " "){
|
||||||
$peerNames =~ s/_chn-01//g; # channel 01 is part of device
|
|
||||||
CUL_HM_UpdtReadSingle($hash,"peerList",$peerNames,0);
|
CUL_HM_UpdtReadSingle($hash,"peerList",$peerNames,0);
|
||||||
$hash->{peerList} = $peerNames;
|
$hash->{peerList} = $peerNames;
|
||||||
if ($st eq "virtual"){
|
if ($st eq "virtual"){
|
||||||
@ -9234,14 +9233,16 @@ sub CUL_HM_getChnList($){ # get reglist assotiated with a channel
|
|||||||
|
|
||||||
sub CUL_HM_getPeers($$) { #return peering information - status and lists
|
sub CUL_HM_getPeers($$) { #return peering information - status and lists
|
||||||
my ($name,$type) = @_;
|
my ($name,$type) = @_;
|
||||||
|
return () if(!defined $name || !defined $defs{$name}|| !defined $defs{$name}{DEF});
|
||||||
my $hashH = $defs{$name}{helper};
|
my $hashH = $defs{$name}{helper};
|
||||||
return () if(!defined $name || !defined $defs{$name}{DEF});
|
|
||||||
my ($devId,$chn) = unpack 'A6A2',$defs{$name}{DEF};
|
my ($devId,$chn) = unpack 'A6A2',$defs{$name}{DEF};
|
||||||
|
|
||||||
if ($type eq "IDs" ){return grep!/00000000/ ,keys%{$hashH->{peerIDsH}};}
|
if ($type eq "IDs" ){return grep!/00000000/ ,keys%{$hashH->{peerIDsH}};}
|
||||||
elsif ($type eq "Names" ){return map{$hashH->{peerIDsH}{$_}} grep!/00000000/ ,keys%{$hashH->{peerIDsH}};}#all peer names
|
|
||||||
elsif ($type eq "IDsExt" ){return grep!/(00000000|$devId)/,keys%{$hashH->{peerIDsH}};}#only external peers
|
elsif ($type eq "IDsExt" ){return grep!/(00000000|$devId)/,keys%{$hashH->{peerIDsH}};}#only external peers
|
||||||
elsif ($type eq "IDsSelf" ){return grep /$devId/ ,keys%{$hashH->{peerIDsH}};}#only own peers
|
elsif ($type eq "IDsSelf" ){return grep /$devId/ ,keys%{$hashH->{peerIDsH}};}#only own peers
|
||||||
|
elsif ($type eq "Names" ){return grep/./,map{(my $foo = $hashH->{peerIDsH}{$_}) =~ s/_chn-..$//;
|
||||||
|
$foo}
|
||||||
|
grep!/00000000/ ,keys%{$hashH->{peerIDsH}};}#all peer names
|
||||||
elsif ($type eq "NamesExt" ){return grep/./,map{(my $foo = $hashH->{peerIDsH}{$_}) =~ s/_chn-..$//;
|
elsif ($type eq "NamesExt" ){return grep/./,map{(my $foo = $hashH->{peerIDsH}{$_}) =~ s/_chn-..$//;
|
||||||
defined($defs{$foo})?$foo:""}
|
defined($defs{$foo})?$foo:""}
|
||||||
grep!/(00000000|$devId)/,keys%{$hashH->{peerIDsH}};}#all external names
|
grep!/(00000000|$devId)/,keys%{$hashH->{peerIDsH}};}#all external names
|
||||||
@ -9272,7 +9273,9 @@ sub CUL_HM_getPeers($$) { #return peering information - status and lists
|
|||||||
}
|
}
|
||||||
elsif ($type =~ m/^ID:(.{8})$/ ){return $hashH->{peerIDsH}{$1} if (defined $hashH->{peerIDsH}{$1});}
|
elsif ($type =~ m/^ID:(.{8})$/ ){return $hashH->{peerIDsH}{$1} if (defined $hashH->{peerIDsH}{$1});}
|
||||||
elsif ($type =~ m/^ID:(.{6})$/ ){return grep /$1../ ,keys%{$hashH->{peerIDsH}};}#peers for a device
|
elsif ($type =~ m/^ID:(.{6})$/ ){return grep /$1../ ,keys%{$hashH->{peerIDsH}};}#peers for a device
|
||||||
elsif ($type =~ m/^Name:(.{6})$/){return map{$hashH->{peerIDsH}{$_}} grep /$1../ ,keys%{$hashH->{peerIDsH}};}#peers for a device
|
elsif ($type =~ m/^Name:(.{6})$/){return grep/./,map{(my $foo = $hashH->{peerIDsH}{$_}) =~ s/_chn-..$//;
|
||||||
|
defined($defs{$foo})?$foo:""}
|
||||||
|
grep /$1../ ,keys%{$hashH->{peerIDsH}};}#peers for a device
|
||||||
();
|
();
|
||||||
}
|
}
|
||||||
sub CUL_HM_getChnPeers($){ #which peertype am I
|
sub CUL_HM_getChnPeers($){ #which peertype am I
|
||||||
|
Loading…
x
Reference in New Issue
Block a user