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

global HMconfig to allow changes

git-svn-id: https://svn.fhem.de/fhem/trunk@4518 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-12-31 11:46:26 +00:00
parent 7e6be5dbc1
commit e5b656c742
4 changed files with 233 additions and 210 deletions

View File

@ -693,9 +693,8 @@ sub HMLAN_SimpleWrite(@) {#####################################################
&& !$hash->{helper}{recoverTest});# no send if overload or disconnect && !$hash->{helper}{recoverTest});# no send if overload or disconnect
delete $hash->{helper}{recoverTest}; # test done delete $hash->{helper}{recoverTest}; # test done
} }
$msg =~ m/(.{9}).(..).(.{8}).(..).(.{8}).(..)(..)(..)(.{6})(.{6})(.*)/; my ($s,undef,$stat,undef,$t,undef,$d,undef,$r,undef,$no,$flg,$typ,$src,$dst,$p) =
my ($s,$stat,$t,$d,$r,$no,$flg,$typ,$src,$dst,$p) = unpack('A9A1A2A1A8A1A2A1A8A1A2A2A2A6A6A*',$msg);
($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);
my $hmId = AttrVal($name,"hmId",""); my $hmId = AttrVal($name,"hmId","");
my $hDst = $hash->{helper}{$dst};# shortcut my $hDst = $hash->{helper}{$dst};# shortcut

View File

@ -10,28 +10,29 @@ use warnings;
use HMConfig; use HMConfig;
# ========================import constants===================================== # ========================import constants=====================================
my %culHmModel =HMConfig::HMConfig_getHash("culHmModel");
my %culHmRegDefShLg =HMConfig::HMConfig_getHash("culHmRegDefShLg"); my $culHmModel =\%HMConfig::culHmModel;
my %culHmRegDefine =HMConfig::HMConfig_getHash("culHmRegDefine"); my $culHmRegDefShLg =\%HMConfig::culHmRegDefShLg;
my %culHmRegGeneral =HMConfig::HMConfig_getHash("culHmRegGeneral"); my $culHmRegDefine =\%HMConfig::culHmRegDefine;
my %culHmRegType =HMConfig::HMConfig_getHash("culHmRegType"); my $culHmRegGeneral =\%HMConfig::culHmRegGeneral;
my %culHmRegModel =HMConfig::HMConfig_getHash("culHmRegModel"); my $culHmRegType =\%HMConfig::culHmRegType;
my %culHmRegChan =HMConfig::HMConfig_getHash("culHmRegChan"); my $culHmRegModel =\%HMConfig::culHmRegModel;
my %culHmGlobalGets =HMConfig::HMConfig_getHash("culHmGlobalGets"); my $culHmRegChan =\%HMConfig::culHmRegChan;
my %culHmSubTypeGets =HMConfig::HMConfig_getHash("culHmSubTypeGets"); my $culHmGlobalGets =\%HMConfig::culHmGlobalGets;
my %culHmModelGets =HMConfig::HMConfig_getHash("culHmModelGets"); my $culHmSubTypeGets =\%HMConfig::culHmSubTypeGets;
my %culHmGlobalSetsDevice =HMConfig::HMConfig_getHash("culHmGlobalSetsDevice"); my $culHmModelGets =\%HMConfig::culHmModelGets;
my %culHmSubTypeDevSets =HMConfig::HMConfig_getHash("culHmSubTypeDevSets"); my $culHmGlobalSetsDevice =\%HMConfig::culHmGlobalSetsDevice;
my %culHmGlobalSetsChn =HMConfig::HMConfig_getHash("culHmGlobalSetsChn"); my $culHmSubTypeDevSets =\%HMConfig::culHmSubTypeDevSets;
my %culHmGlobalSets =HMConfig::HMConfig_getHash("culHmGlobalSets"); my $culHmGlobalSetsChn =\%HMConfig::culHmGlobalSetsChn;
my %culHmGlobalSetsVrtDev =HMConfig::HMConfig_getHash("culHmGlobalSetsVrtDev"); my $culHmGlobalSets =\%HMConfig::culHmGlobalSets;
my %culHmSubTypeSets =HMConfig::HMConfig_getHash("culHmSubTypeSets"); my $culHmGlobalSetsVrtDev =\%HMConfig::culHmGlobalSetsVrtDev;
my %culHmModelSets =HMConfig::HMConfig_getHash("culHmModelSets"); my $culHmSubTypeSets =\%HMConfig::culHmSubTypeSets;
my %culHmChanSets =HMConfig::HMConfig_getHash("culHmChanSets"); my $culHmModelSets =\%HMConfig::culHmModelSets;
my %culHmFunctSets =HMConfig::HMConfig_getHash("culHmFunctSets"); my $culHmChanSets =\%HMConfig::culHmChanSets;
my %culHmBits =HMConfig::HMConfig_getHash("culHmBits"); my $culHmFunctSets =\%HMConfig::culHmFunctSets;
my @culHmCmdFlags =HMConfig::HMConfig_getHash("culHmCmdFlags"); my $culHmBits =\%HMConfig::culHmBits;
my $K_actDetID =HMConfig::HMConfig_getHash("K_actDetID"); my $culHmCmdFlags =\@HMConfig::culHmCmdFlags;
my $K_actDetID =\$HMConfig::K_actDetID;
############################################################ ############################################################
@ -148,12 +149,12 @@ sub CUL_HM_Initialize($) {
# ,4_backUpdt # ,4_backUpdt
my @modellist; my @modellist;
foreach my $model (keys %culHmModel){ foreach my $model (keys %{$culHmModel}){
push @modellist,$culHmModel{$model}{name}; push @modellist,$culHmModel->{$model}{name};
} }
$hash->{AttrList} .= " model:" .join(",", sort @modellist); $hash->{AttrList} .= " model:" .join(",", sort @modellist);
$hash->{AttrList} .= " subType:".join(",", $hash->{AttrList} .= " subType:".join(",",
CUL_HM_noDup(map { $culHmModel{$_}{st} } keys %culHmModel)); CUL_HM_noDup(map { $culHmModel->{$_}{st} } keys %{$culHmModel}));
$hash->{prot}{rspPend} = 0;#count Pending responses $hash->{prot}{rspPend} = 0;#count Pending responses
my @statQArr = (); my @statQArr = ();
@ -225,8 +226,8 @@ sub CUL_HM_updateConfig($){
if ($hash->{helper}{role}{chn}){ if ($hash->{helper}{role}{chn}){
my $chn = (length($id) == 8)?substr($id,6,2):"01"; my $chn = (length($id) == 8)?substr($id,6,2):"01";
my $devId = substr($id,0,6); my $devId = substr($id,0,6);
if ($culHmModel{$mId} && $culHmModel{$mId}{chn} =~ m/Sw._V/){#virtual? if ($culHmModel->{$mId} && $culHmModel->{$mId}{chn} =~ m/Sw._V/){#virtual?
my @chnPh = (grep{$_ =~ m/Sw:/ } split ',',$culHmModel{$mId}{chn}); my @chnPh = (grep{$_ =~ m/Sw:/ } split ',',$culHmModel->{$mId}{chn});
@chnPh = split ':',$chnPh[0] if (@chnPh); @chnPh = split ':',$chnPh[0] if (@chnPh);
my $chnPhyMax = $chnPh[2]?$chnPh[2]:1; # max Phys channels my $chnPhyMax = $chnPh[2]?$chnPh[2]:1; # max Phys channels
my $chnPhy = int(($chn-$chnPhyMax+1)/2); # assotiated phy chan my $chnPhy = int(($chn-$chnPhyMax+1)/2); # assotiated phy chan
@ -434,7 +435,7 @@ sub CUL_HM_Attr(@) {#################################
foreach my $rdEntry (grep /^R-/ ,keys %{$hash->{READINGS}}){ foreach my $rdEntry (grep /^R-/ ,keys %{$hash->{READINGS}}){
my $reg = $rdEntry; my $reg = $rdEntry;
$reg =~ s/.*-//; $reg =~ s/.*-//;
next if(!$culHmRegDefine{$reg} || $culHmRegDefine{$reg}{d} eq '1'); next if(!$culHmRegDefine->{$reg} || $culHmRegDefine->{$reg}{d} eq '1');
$hash->{READINGS}{".".$rdEntry} = $hash->{READINGS}{$rdEntry}; $hash->{READINGS}{".".$rdEntry} = $hash->{READINGS}{$rdEntry};
delete $hash->{READINGS}{$rdEntry}; delete $hash->{READINGS}{$rdEntry};
} }
@ -566,8 +567,8 @@ sub CUL_HM_Parse($$) {##############################
# Generate an UNKNOWN event for pairing requests, ignore everything else # Generate an UNKNOWN event for pairing requests, ignore everything else
if($mTp eq "00") { if($mTp eq "00") {
my $md = substr($p, 2, 4); my $md = substr($p, 2, 4);
$md = $culHmModel{$md}{name} ? $md = $culHmModel->{$md}{name} ?
$culHmModel{$md}{name} : $culHmModel->{$md}{name} :
"ID_".$md; "ID_".$md;
my $sname = "CUL_HM_".$md."_$src"; my $sname = "CUL_HM_".$md."_$src";
$sname =~ s/-/_/g; $sname =~ s/-/_/g;
@ -2065,16 +2066,16 @@ sub CUL_HM_Get($@) {
my $roleD = $hash->{helper}{role}{dev}?1:0; my $roleD = $hash->{helper}{role}{dev}?1:0;
my $roleV = $hash->{helper}{role}{vrt}?1:0; my $roleV = $hash->{helper}{role}{vrt}?1:0;
my $h = $culHmGlobalGets{$cmd}; my $h = $culHmGlobalGets->{$cmd};
$h = $culHmSubTypeGets{$st}{$cmd} if(!defined($h) && $culHmSubTypeGets{$st}); $h = $culHmSubTypeGets->{$st}{$cmd} if(!defined($h) && $culHmSubTypeGets->{$st});
$h = $culHmModelGets{$md}{$cmd} if(!defined($h) && $culHmModelGets{$md}); $h = $culHmModelGets->{$md}{$cmd} if(!defined($h) && $culHmModelGets->{$md});
my @h; my @h;
@h = split(" ", $h) if($h); @h = split(" ", $h) if($h);
if(!defined($h)) { if(!defined($h)) {
my @arr = keys %culHmGlobalGets; my @arr = keys %{$culHmGlobalGets};
push @arr, keys %{$culHmSubTypeGets{$st}} if($culHmSubTypeGets{$st}); push @arr, keys %{$culHmSubTypeGets->{$st}} if($culHmSubTypeGets->{$st});
push @arr, keys %{$culHmModelGets{$md}} if($culHmModelGets{$md}); push @arr, keys %{$culHmModelGets->{$md}} if($culHmModelGets->{$md});
my $usg = "Unknown argument $cmd, choose one of ".join(" ",sort @arr); my $usg = "Unknown argument $cmd, choose one of ".join(" ",sort @arr);
return $usg; return $usg;
@ -2099,10 +2100,10 @@ sub CUL_HM_Get($@) {
elsif($cmd eq "reg") { ##################################################### elsif($cmd eq "reg") { #####################################################
my (undef,undef,$regReq,$list,$peerId) = @a; my (undef,undef,$regReq,$list,$peerId) = @a;
if ($regReq eq 'all'){ if ($regReq eq 'all'){
my @regArr = keys %culHmRegGeneral; my @regArr = keys %{$culHmRegGeneral};
push @regArr, keys %{$culHmRegType{$st}} if($culHmRegType{$st}); push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
push @regArr, keys %{$culHmRegModel{$md}} if($culHmRegModel{$md}); push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
push @regArr, keys %{$culHmRegChan{$md.$chn}} if($culHmRegChan{$md.$chn}); push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
my @peers; # get all peers we have a reglist my @peers; # get all peers we have a reglist
my @listWp; # list that require peers my @listWp; # list that require peers
@ -2117,7 +2118,7 @@ sub CUL_HM_Get($@) {
my @regValList; #storage of results my @regValList; #storage of results
my $regHeader = "list:peer\tregister :value\n"; my $regHeader = "list:peer\tregister :value\n";
foreach my $regName (@regArr){ foreach my $regName (@regArr){
my $regL = $culHmRegDefine{$regName}->{l}; my $regL = $culHmRegDefine->{$regName}->{l};
my @peerExe = (grep (/$regL/,@listWp))?@peers:("00000000"); my @peerExe = (grep (/$regL/,@listWp))?@peers:("00000000");
foreach my $peer(@peerExe){ foreach my $peer(@peerExe){
next if($peer eq ""); next if($peer eq "");
@ -2146,24 +2147,24 @@ sub CUL_HM_Get($@) {
} }
} }
elsif($cmd eq "regList") { ################################################# elsif($cmd eq "regList") { #################################################
my @regArr = keys %culHmRegGeneral ; my @regArr = keys %{$culHmRegGeneral};
push @regArr, keys %{$culHmRegType{$st}} if($culHmRegType{$st}); push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
push @regArr, keys %{$culHmRegModel{$md}} if($culHmRegModel{$md}); push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
if ($isChannel){ if ($isChannel){
push @regArr, keys %{$culHmRegChan{$md.$chn}} if($culHmRegChan{$md.$chn}); push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
} }
else{# add all ugly channel register to device view else{# add all ugly channel register to device view
for my $chnId (CUL_HM_getAssChnIds($name)){ for my $chnId (CUL_HM_getAssChnIds($name)){
my $chnN = substr($chnId,6,2); my $chnN = substr($chnId,6,2);
push @regArr, keys %{$culHmRegChan{$md.$chnN}} push @regArr, keys %{$culHmRegChan->{$md.$chnN}}
if($culHmRegChan{$md.$chnN}); if($culHmRegChan->{$md.$chnN});
} }
} }
my @rI; my @rI;
foreach my $regName (@regArr){ foreach my $regName (@regArr){
my $reg = $culHmRegDefine{$regName}; my $reg = $culHmRegDefine->{$regName};
my $help = $reg->{t}; my $help = $reg->{t};
my ($min,$max) = ($reg->{min},"to ".$reg->{max}); my ($min,$max) = ($reg->{min},"to ".$reg->{max});
if (defined($reg->{lit})){ if (defined($reg->{lit})){
@ -2250,37 +2251,37 @@ sub CUL_HM_Set($@) {
my $roleV = $hash->{helper}{role}{vrt}?1:0; my $roleV = $hash->{helper}{role}{vrt}?1:0;
my $mdCh = $md.($isChannel?$chn:"00"); # chan specific commands? my $mdCh = $md.($isChannel?$chn:"00"); # chan specific commands?
my $fkt = $hash->{helper}{fkt}?$hash->{helper}{fkt}:""; my $fkt = $hash->{helper}{fkt}?$hash->{helper}{fkt}:"";
my $h = $culHmGlobalSets{$cmd} if( $st ne "virtual"); my $h = $culHmGlobalSets->{$cmd} if( $st ne "virtual");
$h = $culHmGlobalSetsVrtDev{$cmd} if(!defined($h) &&($st eq "virtual"||!$st) && $roleD); $h = $culHmGlobalSetsVrtDev->{$cmd} if(!defined($h) &&($st eq "virtual"||!$st) && $roleD);
$h = $culHmGlobalSetsDevice{$cmd} if(!defined($h) && $st ne "virtual" && $roleD); $h = $culHmGlobalSetsDevice->{$cmd} if(!defined($h) && $st ne "virtual" && $roleD);
$h = $culHmSubTypeDevSets{$st}{$cmd}if(!defined($h) && $st ne "virtual" && $roleD); $h = $culHmSubTypeDevSets->{$st}{$cmd}if(!defined($h) && $st ne "virtual" && $roleD);
$h = $culHmGlobalSetsChn{$cmd} if(!defined($h) && $st ne "virtual" && $roleC); $h = $culHmGlobalSetsChn->{$cmd} if(!defined($h) && $st ne "virtual" && $roleC);
$h = $culHmSubTypeSets{$st}{$cmd} if(!defined($h) && $culHmSubTypeSets{$st} && $roleC); $h = $culHmSubTypeSets->{$st}{$cmd} if(!defined($h) && $culHmSubTypeSets->{$st} && $roleC);
$h = $culHmModelSets{$md}{$cmd} if(!defined($h) && $culHmModelSets{$md} ); $h = $culHmModelSets->{$md}{$cmd} if(!defined($h) && $culHmModelSets->{$md} );
$h = $culHmChanSets{$md."00"}{$cmd} if(!defined($h) && $culHmChanSets{$md."00"} && $roleD); $h = $culHmChanSets->{$md."00"}{$cmd} if(!defined($h) && $culHmChanSets->{$md."00"} && $roleD);
$h = $culHmChanSets{$md.$chn}{$cmd} if(!defined($h) && $culHmChanSets{$md.$chn} && $roleC); $h = $culHmChanSets->{$md.$chn}{$cmd} if(!defined($h) && $culHmChanSets->{$md.$chn} && $roleC);
$h = $culHmFunctSets{$fkt}{$cmd} if(!defined($h) && $culHmFunctSets{$fkt}); $h = $culHmFunctSets->{$fkt}{$cmd} if(!defined($h) && $culHmFunctSets->{$fkt});
my @h; my @h;
@h = split(" ", $h) if($h); @h = split(" ", $h) if($h);
my @postCmds=(); #Commands to be appended after regSet (ugly...) my @postCmds=(); #Commands to be appended after regSet (ugly...)
if(!defined($h) && defined($culHmSubTypeSets{$st}{pct}) && $cmd =~ m/^\d+/) { if(!defined($h) && defined($culHmSubTypeSets->{$st}{pct}) && $cmd =~ m/^\d+/) {
splice @a, 1, 0,"pct";#insert the actual command splice @a, 1, 0,"pct";#insert the actual command
} }
elsif(!defined($h)) { elsif(!defined($h)) {
my @arr1 = (); my @arr1 = ();
if( $st ne "virtual") {foreach(keys %culHmGlobalSets ){push @arr1,"$_:$culHmGlobalSets{$_}" }}; if( $st ne "virtual") {foreach(keys %{$culHmGlobalSets} ){push @arr1,"$_:".$culHmGlobalSets->{$_} }};
if(($st eq "virtual"||!$st) && $roleD){foreach(keys %culHmGlobalSetsVrtDev ){push @arr1,"$_:$culHmGlobalSetsVrtDev{$_}" }}; if(($st eq "virtual"||!$st) && $roleD){foreach(keys %{$culHmGlobalSetsVrtDev} ){push @arr1,"$_:".$culHmGlobalSetsVrtDev->{$_} }};
if( $st ne "virtual" && $roleD){foreach(keys %culHmGlobalSetsDevice ){push @arr1,"$_:$culHmGlobalSetsDevice{$_}" }}; if( $st ne "virtual" && $roleD){foreach(keys %{$culHmGlobalSetsDevice} ){push @arr1,"$_:".$culHmGlobalSetsDevice->{$_} }};
if( $st ne "virtual" && $roleD){foreach(keys %{$culHmSubTypeDevSets{$st}}){push @arr1,"$_:${$culHmSubTypeDevSets{$st}}{$_}"}}; if( $st ne "virtual" && $roleD){foreach(keys %{$culHmSubTypeDevSets->{$st}}){push @arr1,"$_:".${$culHmSubTypeDevSets->{$st}}{$_}}};
if( $st ne "virtual" && $roleC){foreach(keys %culHmGlobalSetsChn ){push @arr1,"$_:$culHmGlobalSetsChn{$_}" }}; if( $st ne "virtual" && $roleC){foreach(keys %{$culHmGlobalSetsChn} ){push @arr1,"$_:".$culHmGlobalSetsChn->{$_} }};
if( $culHmSubTypeSets{$st} && $roleC){foreach(keys %{$culHmSubTypeSets{$st}} ){push @arr1,"$_:${$culHmSubTypeSets{$st}}{$_}" }}; if( $culHmSubTypeSets->{$st} && $roleC){foreach(keys %{$culHmSubTypeSets->{$st}} ){push @arr1,"$_:".${$culHmSubTypeSets->{$st}}{$_} }};
if( $culHmModelSets{$md}) {foreach(keys %{$culHmModelSets{$md}} ){push @arr1,"$_:${$culHmModelSets{$md}}{$_}" }}; if( $culHmModelSets->{$md}) {foreach(keys %{$culHmModelSets->{$md}} ){push @arr1,"$_:".${$culHmModelSets->{$md}}{$_} }};
if( $culHmChanSets{$md."00"} && $roleD){foreach(keys %{$culHmChanSets{$md."00"}} ){push @arr1,"$_:".${$culHmChanSets{$md."00"}}{$_}}}; if( $culHmChanSets->{$md."00"} && $roleD){foreach(keys %{$culHmChanSets->{$md."00"}} ){push @arr1,"$_:".${$culHmChanSets->{$md."00"}}{$_} }};
if( $culHmChanSets{$md.$chn} && $roleC){foreach(keys %{$culHmChanSets{$md.$chn}} ){push @arr1,"$_:".${$culHmChanSets{$md.$chn}}{$_}}}; if( $culHmChanSets->{$md.$chn} && $roleC){foreach(keys %{$culHmChanSets->{$md.$chn}} ){push @arr1,"$_:".${$culHmChanSets->{$md.$chn}}{$_} }};
if( $culHmFunctSets{$fkt} && $roleC){foreach(keys %{$culHmFunctSets{$fkt}} ){push @arr1,"$_:".${$culHmFunctSets{$fkt}}{$_} }}; if( $culHmFunctSets->{$fkt} && $roleC){foreach(keys %{$culHmFunctSets->{$fkt}} ){push @arr1,"$_:".${$culHmFunctSets->{$fkt}}{$_} }};
@arr1 = CUL_HM_noDup(@arr1); @arr1 = CUL_HM_noDup(@arr1);
foreach(@arr1){ foreach(@arr1){
my ($cmd,$val) = split(":",$_,2); my ($cmd,$val) = split(":",$_,2);
@ -2502,9 +2503,9 @@ sub CUL_HM_Set($@) {
return "unknown peer".$peer if (length($pID) != 8);# peer only to channel return "unknown peer".$peer if (length($pID) != 8);# peer only to channel
my $pCh1 = substr($pID,6,2); my $pCh1 = substr($pID,6,2);
my $pCh2 = $pCh1; my $pCh2 = $pCh1;
if(($culHmSubTypeSets{$st} &&$culHmSubTypeSets{$st}{peerChan} )|| if(($culHmSubTypeSets->{$st} &&$culHmSubTypeSets->{$st}{peerChan} )||
($culHmModelSets{$md} &&$culHmModelSets{$md}{peerChan} )|| ($culHmModelSets->{$md} &&$culHmModelSets->{$md}{peerChan} )||
($culHmChanSets{$md.$chn} &&$culHmChanSets{$md.$chn}{peerChan}) ){ ($culHmChanSets->{$md.$chn} &&$culHmChanSets->{$md.$chn}{peerChan}) ){
$pCh2 = "00"; # button behavior $pCh2 = "00"; # button behavior
} }
CUL_HM_PushCmdStack($hash,'++'.$flag.'01'.$id.$dst.$chn.$set. CUL_HM_PushCmdStack($hash,'++'.$flag.'01'.$id.$dst.$chn.$set.
@ -2578,18 +2579,18 @@ sub CUL_HM_Set($@) {
my (undef,undef,$regName,$data,$peerChnIn) = @a; my (undef,undef,$regName,$data,$peerChnIn) = @a;
$state = ""; $state = "";
if (!$culHmRegType{$st}{$regName} && if (!$culHmRegType->{$st}{$regName} &&
!$culHmRegGeneral{$regName} && !$culHmRegGeneral->{$regName} &&
!$culHmRegModel{$md}{$regName} && !$culHmRegModel->{$md}{$regName} &&
!$culHmRegChan{$md.$chn}{$regName} ){ !$culHmRegChan->{$md.$chn}{$regName} ){
my @regArr = keys %culHmRegGeneral ; my @regArr = keys %{$culHmRegGeneral};
push @regArr, keys %{$culHmRegType{$st}} if($culHmRegType{$st}); push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
push @regArr, keys %{$culHmRegModel{$md}} if($culHmRegModel{$md}); push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
push @regArr, keys %{$culHmRegChan{$md.$chn}} if($culHmRegChan{$md.$chn}); push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
return "$regName failed: supported register are ".join(" ",sort @regArr); return "$regName failed: supported register are ".join(" ",sort @regArr);
} }
my $reg = $culHmRegDefine{$regName}; my $reg = $culHmRegDefine->{$regName};
return $st." - ".$regName # give some help return $st." - ".$regName # give some help
.($reg->{lit}? " literal:".join(",",keys%{$reg->{lit}})." " .($reg->{lit}? " literal:".join(",",keys%{$reg->{lit}})." "
: " range:". $reg->{min}." to ".$reg->{max}.$reg->{u} : " range:". $reg->{min}." to ".$reg->{max}.$reg->{u}
@ -3309,8 +3310,8 @@ sub CUL_HM_Set($@) {
# First the remote (one loop for on, one for off) # First the remote (one loop for on, one for off)
if (!$target || $target =~ m/^(remote|both)$/){ if (!$target || $target =~ m/^(remote|both)$/){
my $burst; my $burst;
if ($culHmRegModel{$md}{peerNeedsBurst}|| #peerNeedsBurst supported if ($culHmRegModel->{$md}{peerNeedsBurst}|| #peerNeedsBurst supported
$culHmRegType{$st}{peerNeedsBurst}){ $culHmRegType->{$st}{peerNeedsBurst}){
$burst = (CUL_HM_getRxType($peerHash) & 0x82) #burst |burstConditional $burst = (CUL_HM_getRxType($peerHash) & 0x82) #burst |burstConditional
?"0101" ?"0101"
:"0100"; :"0100";
@ -3420,9 +3421,9 @@ sub CUL_HM_infoUpdtDevData($$$) {#autoread config
my($name,$hash,$p) = @_; my($name,$hash,$p) = @_;
my($fw1,$fw2,$mId,$serNo,$stc,$devInfo) = unpack('A1A1A4A20A2A*', $p); my($fw1,$fw2,$mId,$serNo,$stc,$devInfo) = unpack('A1A1A4A20A2A*', $p);
my $md = $culHmModel{$mId}{name} ? $culHmModel{$mId}{name}:"unknown"; my $md = $culHmModel->{$mId}{name} ? $culHmModel->{$mId}{name}:"unknown";
$attr{$name}{model} = $md; $attr{$name}{model} = $md;
$attr{$name}{subType} = $culHmModel{$mId}{st}; $attr{$name}{subType} = $culHmModel->{$mId}{st};
$attr{$name}{serialNr} = pack('H*',$serNo); $attr{$name}{serialNr} = pack('H*',$serNo);
#expert level attributes #expert level attributes
$attr{$name}{firmware} = sprintf("%d.%d", hex($fw1),hex($fw2)); $attr{$name}{firmware} = sprintf("%d.%d", hex($fw1),hex($fw2));
@ -3434,7 +3435,7 @@ sub CUL_HM_infoUpdtDevData($$$) {#autoread config
$mId = CUL_HM_getMId($hash);# set helper valiable and use result $mId = CUL_HM_getMId($hash);# set helper valiable and use result
# autocreate undefined channels # autocreate undefined channels
my @chanTypesList = split(',',$culHmModel{$mId}{chn}); my @chanTypesList = split(',',$culHmModel->{$mId}{chn});
my $startime = gettimeofday()+1; my $startime = gettimeofday()+1;
foreach my $chantype (@chanTypesList){ foreach my $chantype (@chanTypesList){
my ($chnTpName,$chnStart,$chnEnd) = split(':',$chantype); my ($chnTpName,$chnStart,$chnEnd) = split(':',$chantype);
@ -3451,9 +3452,9 @@ sub CUL_HM_infoUpdtDevData($$$) {#autoread config
$chnNoTyp++; $chnNoTyp++;
} }
} }
if ($culHmModel{$mId}{cyc}){ if ($culHmModel->{$mId}{cyc}){
CUL_HM_ActAdd($hash->{DEF},AttrVal($name,"actCycle", CUL_HM_ActAdd($hash->{DEF},AttrVal($name,"actCycle",
$culHmModel{$mId}{cyc})); $culHmModel->{$mId}{cyc}));
} }
} }
sub CUL_HM_infoUpdtChanData(@) {# verify attributes after reboot sub CUL_HM_infoUpdtChanData(@) {# verify attributes after reboot
@ -3477,7 +3478,7 @@ sub CUL_HM_getConfig($){
my $chn = substr($channel,6,2); my $chn = substr($channel,6,2);
delete $cHash->{READINGS}{$_} delete $cHash->{READINGS}{$_}
foreach (grep /^[\.]?(RegL_)/,keys %{$cHash->{READINGS}}); foreach (grep /^[\.]?(RegL_)/,keys %{$cHash->{READINGS}});
my $lstAr = $culHmModel{CUL_HM_getMId($cHash)}{lst}; my $lstAr = $culHmModel->{CUL_HM_getMId($cHash)}{lst};
if($lstAr){ if($lstAr){
my @list = split(",",$lstAr); #get valid lists e.g."1, 5:2.3p ,6:2" my @list = split(",",$lstAr); #get valid lists e.g."1, 5:2.3p ,6:2"
my $pReq = 0; # Peer request not issued, do only once for channel my $pReq = 0; # Peer request not issued, do only once for channel
@ -4183,9 +4184,9 @@ sub CUL_HM_getMId($) {#in: hash(chn or dev) out:model key (key for %culHmModel)
my $mId = $hash->{helper}{mId}; my $mId = $hash->{helper}{mId};
if (!$mId){ if (!$mId){
my $model = AttrVal($hash->{NAME}, "model", ""); my $model = AttrVal($hash->{NAME}, "model", "");
foreach my $mIdKey(keys%culHmModel){ foreach my $mIdKey(keys%{$culHmModel}){
next if (!$culHmModel{$mIdKey}{name} || next if (!$culHmModel->{$mIdKey}{name} ||
$culHmModel{$mIdKey}{name} ne $model); $culHmModel->{$mIdKey}{name} ne $model);
$hash->{helper}{mId} = $mIdKey ; $hash->{helper}{mId} = $mIdKey ;
return $mIdKey; return $mIdKey;
} }
@ -4202,7 +4203,7 @@ sub CUL_HM_getRxType($) { #in:hash(chn or dev) out:binary coded Rx type
use warnings; use warnings;
if (!$rxtEntity){ #at least one bit must be set if (!$rxtEntity){ #at least one bit must be set
my $MId = CUL_HM_getMId($hash); my $MId = CUL_HM_getMId($hash);
my $rxtOfModel = $culHmModel{$MId}{rxt} if ($MId && $culHmModel{$MId}{rxt}); my $rxtOfModel = $culHmModel->{$MId}{rxt} if ($MId && $culHmModel->{$MId}{rxt});
if ($rxtOfModel){ if ($rxtOfModel){
$rxtEntity |= ($rxtOfModel =~ m/b/)?0x02:0;#burst $rxtEntity |= ($rxtOfModel =~ m/b/)?0x02:0;#burst
$rxtEntity |= ($rxtOfModel =~ m/c/)?0x04:0;#config $rxtEntity |= ($rxtOfModel =~ m/c/)?0x04:0;#config
@ -4335,15 +4336,15 @@ sub CUL_HM_DumpProtocol($$@) {
# decode message flags for printing # decode message flags for printing
my $msgFlLong=""; my $msgFlLong="";
my $msgFlagsHex = hex($msgFlags); my $msgFlagsHex = hex($msgFlags);
for(my $i = 0; $i < @culHmCmdFlags; $i++) { for(my $i = 0; $i < @{$culHmCmdFlags}; $i++) {
$msgFlLong .= ",$culHmCmdFlags[$i]" if($msgFlagsHex & (1<<$i)); $msgFlLong .= ",".${$culHmCmdFlags}[$i] if($msgFlagsHex & (1<<$i));
} }
my $ps; my $ps;
$ps = $culHmBits{"$mTp;p11=$p11"} if(!$ps); $ps = $culHmBits->{"$mTp;p11=$p11"} if(!$ps);
$ps = $culHmBits{"$mTp;p01=$p01"} if(!$ps); $ps = $culHmBits->{"$mTp;p01=$p01"} if(!$ps);
$ps = $culHmBits{"$mTp;p02=$p02"} if(!$ps); $ps = $culHmBits->{"$mTp;p02=$p02"} if(!$ps);
$ps = $culHmBits{"$mTp"} if(!$ps); $ps = $culHmBits->{"$mTp"} if(!$ps);
my $txt = ""; my $txt = "";
if($ps) { if($ps) {
$txt = $ps->{txt}; $txt = $ps->{txt};
@ -4372,7 +4373,7 @@ sub CUL_HM_getRegFromStore($$$$@) {#read a register from backup data
my $hash = $defs{$name}; my $hash = $defs{$name};
my ($size,$pos,$conversion,$factor,$unit) = (8,0,"",1,""); # default my ($size,$pos,$conversion,$factor,$unit) = (8,0,"",1,""); # default
my $addr = $regName; my $addr = $regName;
my $reg = $culHmRegDefine{$regName}; my $reg = $culHmRegDefine->{$regName};
if ($reg) { # get the register's information if ($reg) { # get the register's information
$addr = $reg->{a}; $addr = $reg->{a};
$pos = ($addr*10)%10; $pos = ($addr*10)%10;
@ -4444,10 +4445,10 @@ sub CUL_HM_updtRegDisp($$$) {
my $md = $attr{$devName}{model} ?$attr{$devName}{model} :""; my $md = $attr{$devName}{model} ?$attr{$devName}{model} :"";
my $chn = $hash->{DEF}; my $chn = $hash->{DEF};
$chn = (length($chn) == 8)?substr($chn,6,2):""; $chn = (length($chn) == 8)?substr($chn,6,2):"";
my @regArr = keys %culHmRegGeneral; my @regArr = keys %{$culHmRegGeneral};
push @regArr, keys %{$culHmRegType{$st}} if($culHmRegType{$st}); push @regArr, keys %{$culHmRegType->{$st}} if($culHmRegType->{$st});
push @regArr, keys %{$culHmRegModel{$md}} if($culHmRegModel{$md}); push @regArr, keys %{$culHmRegModel->{$md}} if($culHmRegModel->{$md});
push @regArr, keys %{$culHmRegChan{$md.$chn}} if($culHmRegChan{$md.$chn}); push @regArr, keys %{$culHmRegChan->{$md.$chn}} if($culHmRegChan->{$md.$chn});
my @changedRead; my @changedRead;
my $expL = CUL_HM_getAttrInt($name,"expert"); my $expL = CUL_HM_getAttrInt($name,"expert");
my $expLvl = ($expL != 0)?1:0; my $expLvl = ($expL != 0)?1:0;
@ -4457,10 +4458,10 @@ sub CUL_HM_updtRegDisp($$$) {
substr(CUL_HM_name2Id($name),0,6), substr(CUL_HM_name2Id($name),0,6),
CUL_HM_IOid($hash)):""); CUL_HM_IOid($hash)):"");
foreach my $rgN (@regArr){ foreach my $rgN (@regArr){
next if ($culHmRegDefine{$rgN}->{l} ne $listNo); next if ($culHmRegDefine->{$rgN}->{l} ne $listNo);
my $rgVal = CUL_HM_getRegFromStore($name,$rgN,$list,$peerId,$regLN); my $rgVal = CUL_HM_getRegFromStore($name,$rgN,$list,$peerId,$regLN);
next if (!$rgVal || $rgVal eq "invalid"); next if (!$rgVal || $rgVal eq "invalid");
my $rdN = ((!$expLvl && !$culHmRegDefine{$rgN}->{d})?".":"").$pReg.$rgN; my $rdN = ((!$expLvl && !$culHmRegDefine->{$rgN}->{d})?".":"").$pReg.$rgN;
push (@changedRead,$rdN.":".$rgVal) push (@changedRead,$rdN.":".$rgVal)
if (ReadingsVal($name,$rdN,"") ne $rgVal); if (ReadingsVal($name,$rdN,"") ne $rgVal);
} }
@ -4583,42 +4584,42 @@ sub CUL_HM_getChnLvl($){# in: name out: vit or phys level
#--------------- Conversion routines for register settings--------------------- #--------------- Conversion routines for register settings---------------------
sub CUL_HM_initRegHash() { #duplicate short and long press register sub CUL_HM_initRegHash() { #duplicate short and long press register
foreach my $reg (keys %culHmRegDefShLg){ #update register list foreach my $reg (keys %{$culHmRegDefShLg}){ #update register list
%{$culHmRegDefine{"sh".$reg}} = %{$culHmRegDefShLg{$reg}}; %{$culHmRegDefine->{"sh".$reg}} = %{$culHmRegDefShLg->{$reg}};
%{$culHmRegDefine{"lg".$reg}} = %{$culHmRegDefShLg{$reg}}; %{$culHmRegDefine->{"lg".$reg}} = %{$culHmRegDefShLg->{$reg}};
$culHmRegDefine{"lg".$reg}{a} +=0x80; $culHmRegDefine->{"lg".$reg}{a} +=0x80;
} }
foreach my $rN (keys %culHmRegDefine){#create literal inverse for fast search foreach my $rN (keys %{$culHmRegDefine}){#create literal inverse for fast search
if ($culHmRegDefine{$rN}{lit}){# literal assigned => create inverse if ($culHmRegDefine->{$rN}{lit}){# literal assigned => create inverse
foreach my $lit (keys %{$culHmRegDefine{$rN}{lit}}){ foreach my $lit (keys %{$culHmRegDefine->{$rN}{lit}}){
$culHmRegDefine{$rN}{litInv}{$culHmRegDefine{$rN}{lit}{$lit}}=$lit; $culHmRegDefine->{$rN}{litInv}{$culHmRegDefine->{$rN}{lit}{$lit}}=$lit;
} }
} }
} }
foreach my $type(sort(keys %culHmRegType)){ #update references to register foreach my $type(sort(keys %{$culHmRegType})){ #update references to register
foreach my $reg (sort(keys %{$culHmRegType{$type}})){ foreach my $reg (sort(keys %{$culHmRegType->{$type}})){
if ($culHmRegDefShLg{$reg}){ if ($culHmRegDefShLg->{$reg}){
delete $culHmRegType{$type}{$reg}; delete $culHmRegType->{$type}{$reg};
$culHmRegType{$type}{"sh".$reg} = 1; $culHmRegType->{$type}{"sh".$reg} = 1;
$culHmRegType{$type}{"lg".$reg} = 1; $culHmRegType->{$type}{"lg".$reg} = 1;
} }
} }
} }
foreach my $type(sort(keys %culHmRegModel)){ #update references to register foreach my $type(sort(keys %{$culHmRegModel})){ #update references to register
foreach my $reg (sort(keys %{$culHmRegModel{$type}})){ foreach my $reg (sort(keys %{$culHmRegModel->{$type}})){
if ($culHmRegDefShLg{$reg}){ if ($culHmRegDefShLg->{$reg}){
delete $culHmRegModel{$type}{$reg}; delete $culHmRegModel->{$type}{$reg};
$culHmRegModel{$type}{"sh".$reg} = 1; $culHmRegModel->{$type}{"sh".$reg} = 1;
$culHmRegModel{$type}{"lg".$reg} = 1; $culHmRegModel->{$type}{"lg".$reg} = 1;
} }
} }
} }
foreach my $type(sort(keys %culHmRegChan)){ #update references to register foreach my $type(sort(keys %{$culHmRegChan})){ #update references to register
foreach my $reg (sort(keys %{$culHmRegChan{$type}})){ foreach my $reg (sort(keys %{$culHmRegChan->{$type}})){
if ($culHmRegDefShLg{$reg}){ if ($culHmRegDefShLg->{$reg}){
delete $culHmRegChan{$type}{$reg}; delete $culHmRegChan->{$type}{$reg};
$culHmRegChan{$type}{"sh".$reg} = 1; $culHmRegChan->{$type}{"sh".$reg} = 1;
$culHmRegChan{$type}{"lg".$reg} = 1; $culHmRegChan->{$type}{"lg".$reg} = 1;
} }
} }
} }
@ -4694,7 +4695,7 @@ sub CUL_HM_4DisText($) { # convert text for 4dis
$txtHex =~ s/ ..:/,/g; #remove addr $txtHex =~ s/ ..:/,/g; #remove addr
$txtHex =~ s/,00.*//; #remove trailing string $txtHex =~ s/,00.*//; #remove trailing string
my @ch = split(",",$txtHex,12); my @ch = split(",",$txtHex,12);
foreach (@ch){$txt{$sAddr}.=chr(hex($_))}; foreach (@ch){$txt{$sAddr}.=chr(hex($_)) if (length($_)==2)};
} }
CUL_HM_UpdtReadBulk($hash,1,"text1:".$pref.$txt{54}, CUL_HM_UpdtReadBulk($hash,1,"text1:".$pref.$txt{54},
"text2:".$pref.$txt{70}); "text2:".$pref.$txt{70});
@ -5314,7 +5315,7 @@ sub CUL_HM_getAttrInt($@){#return attrValue as integer
#+++++++++++++++++ external use +++++++++++++++++++++++++++++++++++++++++++++++ #+++++++++++++++++ external use +++++++++++++++++++++++++++++++++++++++++++++++
sub CUL_HM_putHash($) {# provide data for HMinfo sub CUL_HM_putHash($) {# provide data for HMinfo
my ($info) = @_; my ($info) = @_;
return %culHmModel if ($info eq "culHmModel"); return %{$culHmModel} if ($info eq "culHmModel");
} }
sub CUL_HM_peerUsed($) {# are peers expected? sub CUL_HM_peerUsed($) {# are peers expected?
@ -5327,8 +5328,8 @@ sub CUL_HM_peerUsed($) {# are peers expected?
my $mId = CUL_HM_getMId($hash); my $mId = CUL_HM_getMId($hash);
my $cNo = hex(substr($hash->{DEF}."01",6,2))."p"; #default to channel 01 my $cNo = hex(substr($hash->{DEF}."01",6,2))."p"; #default to channel 01
return 0 if (!$mId || !$culHmModel{$mId}); return 0 if (!$mId || !$culHmModel->{$mId});
foreach my $ls (split ",",$culHmModel{$mId}{lst}){ foreach my $ls (split ",",$culHmModel->{$mId}{lst}){
my ($l,$c) = split":",$ls; my ($l,$c) = split":",$ls;
if ( ($l =~ m/^(p|3|4)$/ && !$c ) # 3,4,p without chanspec if ( ($l =~ m/^(p|3|4)$/ && !$c ) # 3,4,p without chanspec
||($c && $c =~ m/$cNo/ )){ ||($c && $c =~ m/$cNo/ )){
@ -5358,13 +5359,13 @@ sub CUL_HM_reglUsed($) {# provide data for HMinfo
my @lsNo; my @lsNo;
my $mId = CUL_HM_getMId($hash); my $mId = CUL_HM_getMId($hash);
return undef if (!$mId || !$culHmModel{$mId}); return undef if (!$mId || !$culHmModel->{$mId});
if ($hash->{helper}{role}{dev}){ if ($hash->{helper}{role}{dev}){
push @lsNo,"0:"; push @lsNo,"0:";
} }
elsif ($hash->{helper}{role}{chn}){ elsif ($hash->{helper}{role}{chn}){
foreach my $ls (split ",",$culHmModel{$mId}{lst}){ foreach my $ls (split ",",$culHmModel->{$mId}{lst}){
my ($l,$c) = split":",$ls; my ($l,$c) = split":",$ls;
if ($l ne "p"){# ignore peer-only entries if ($l ne "p"){# ignore peer-only entries
if ($c){ if ($c){

View File

@ -15,6 +15,7 @@ sub HMinfo_SetFn($@);
sub HMinfo_SetFnDly($); sub HMinfo_SetFnDly($);
use Blocking; use Blocking;
use HMConfig;
sub HMinfo_Initialize($$) {#################################################### sub HMinfo_Initialize($$) {####################################################
my ($hash) = @_; my ($hash) = @_;
@ -137,8 +138,6 @@ sub HMinfo_regCheck(@) { ######################################################
my @regMissing; my @regMissing;
my @peerRegsFail; my @peerRegsFail;
my %th = CUL_HM_putHash("culHmModel");
foreach my $eName (@entities){ foreach my $eName (@entities){
my $ehash = $defs{$eName}; my $ehash = $defs{$eName};
@ -166,7 +165,6 @@ sub HMinfo_peerCheck(@) { #####################################################
my @peerIDsFail; my @peerIDsFail;
my @peerIDsEmpty; my @peerIDsEmpty;
my @peerIDsNoPeer; my @peerIDsNoPeer;
my %th = CUL_HM_putHash("culHmModel");
foreach my $eName (@entities){ foreach my $eName (@entities){
next if (!$defs{$eName}{helper}{role}{chn});#device has no channels next if (!$defs{$eName}{helper}{role}{chn});#device has no channels
next if (!CUL_HM_peerUsed($eName)); next if (!CUL_HM_peerUsed($eName));
@ -209,7 +207,6 @@ sub HMinfo_burstCheck(@) { ####################################################
my @entities = @_; my @entities = @_;
my @peerIDsNeed; my @peerIDsNeed;
my @peerIDsCond; my @peerIDsCond;
my %th = CUL_HM_putHash("culHmModel");
foreach my $eName (@entities){ foreach my $eName (@entities){
next if (!$defs{$eName}{helper}{role}{chn});#device has no channels next if (!$defs{$eName}{helper}{role}{chn});#device has no channels
next if (!CUL_HM_peerUsed($eName)); next if (!CUL_HM_peerUsed($eName));
@ -243,7 +240,6 @@ sub HMinfo_paramCheck(@) { ####################################################
my @noIoDev; my @noIoDev;
my @noID; my @noID;
my @idMismatch; my @idMismatch;
my %th = CUL_HM_putHash("culHmModel");
foreach my $eName (@entities){ foreach my $eName (@entities){
next if (!$defs{$eName}{helper}{role}{dev}); next if (!$defs{$eName}{helper}{role}{dev});
my $ehash = $defs{$eName}; my $ehash = $defs{$eName};
@ -583,10 +579,10 @@ sub HMinfo_SetFn($@) {#########################################################
; ;
} }
elsif($cmd eq "models") {##print capability, models---------------------- elsif($cmd eq "models") {##print capability, models----------------------
my %th = CUL_HM_putHash("culHmModel"); my $th = \%HMConfig::culHmModel;
my @model; my @model;
foreach (keys %th){ foreach (keys %{$th}){
my $mode = $th{$_}{rxt}; my $mode = $th->{$_}{rxt};
$mode =~ s/c/config/; $mode =~ s/c/config/;
$mode =~ s/w/wakeup/; $mode =~ s/w/wakeup/;
$mode =~ s/b/burst/; $mode =~ s/b/burst/;
@ -594,20 +590,20 @@ sub HMinfo_SetFn($@) {#########################################################
$mode =~ s/\bf\b/burstCond/; $mode =~ s/\bf\b/burstCond/;
$mode =~ s/:/,/g; $mode =~ s/:/,/g;
$mode = "normal" if (!$mode); $mode = "normal" if (!$mode);
my $list = $th{$_}{lst}; my $list = $th->{$_}{lst};
$list =~ s/.://g; $list =~ s/.://g;
$list =~ s/p//; $list =~ s/p//;
my $chan = ""; my $chan = "";
foreach (split",",$th{$_}{chn}){ foreach (split",",$th->{$_}{chn}){
my ($n,$s,$e) = split(":",$_); my ($n,$s,$e) = split(":",$_);
$chan .= $s.(($s eq $e)?"":("-".$e))." ".$n.", "; $chan .= $s.(($s eq $e)?"":("-".$e))." ".$n.", ";
} }
push @model,sprintf("%-16s %-24s %4s %-24s %-5s %-5s %s" push @model,sprintf("%-16s %-24s %4s %-24s %-5s %-5s %s"
,$th{$_}{st} ,$th->{$_}{st}
,$th{$_}{name} ,$th->{$_}{name}
,$_ ,$_
,$mode ,$mode
,$th{$_}{cyc} ,$th->{$_}{cyc}
,$list ,$list
,$chan ,$chan
); );

View File

@ -9,6 +9,30 @@ package HMConfig;
use strict; use strict;
use warnings; use warnings;
############globals############
use vars qw(%culHmModel);
use vars qw(%culHmRegDefShLg);
use vars qw(%culHmRegDefine);
use vars qw(%culHmRegGeneral);
use vars qw(%culHmRegType);
use vars qw(%culHmRegModel);
use vars qw(%culHmRegChan);
use vars qw(%culHmGlobalGets);
use vars qw(%culHmSubTypeGets);
use vars qw(%culHmModelGets);
use vars qw(%culHmGlobalSetsDevice);
use vars qw(%culHmSubTypeDevSets);
use vars qw(%culHmGlobalSetsChn);
use vars qw(%culHmGlobalSets);
use vars qw(%culHmGlobalSetsVrtDev);
use vars qw(%culHmSubTypeSets);
use vars qw(%culHmModelSets);
use vars qw(%culHmChanSets);
use vars qw(%culHmFunctSets);
use vars qw(%culHmBits);
use vars qw(@culHmCmdFlags);
use vars qw($K_actDetID);
# ----------------modul globals----------------------- # ----------------modul globals-----------------------
my $K_actDetID = '000000'; # id of actionDetector my $K_actDetID = '000000'; # id of actionDetector
@ -53,7 +77,7 @@ my $K_actDetID = '000000'; # id of actionDetector
# => list 5 only for channel 3 but assotiated with peers # => list 5 only for channel 3 but assotiated with peers
# => list 5 for channel 4 and 5 with peer=00000000 # => list 5 for channel 4 and 5 with peer=00000000
# #
my %culHmModel=( %culHmModel=(
"0001" => {name=>"HM-LC-SW1-PL-OM54" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"",}, "0001" => {name=>"HM-LC-SW1-PL-OM54" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"",},
"0002" => {name=>"HM-LC-SW1-SM" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"",}, "0002" => {name=>"HM-LC-SW1-SM" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"",},
"0003" => {name=>"HM-LC-SW4-SM" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"Sw:1:4",}, "0003" => {name=>"HM-LC-SW4-SM" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"Sw:1:4",},
@ -257,7 +281,7 @@ my %culHmModel=(
# lit: if the command is a literal options will be entered here # lit: if the command is a literal options will be entered here
# d: if '1' the register will appear in Readings # d: if '1' the register will appear in Readings
# #
my %culHmRegDefShLg = (# register that are available for short AND long button press. Will be merged to rgister list at init %culHmRegDefShLg = (# register that are available for short AND long button press. Will be merged to rgister list at init
#blindActuator mainly #blindActuator mainly
ActionType =>{a=> 10.0,s=>0.2,l=>3,min=>0 ,max=>3 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"" ,lit=>{off=>0,jmpToTarget=>1,toggleToCnt=>2,toggleToCntInv=>3}}, ActionType =>{a=> 10.0,s=>0.2,l=>3,min=>0 ,max=>3 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"" ,lit=>{off=>0,jmpToTarget=>1,toggleToCnt=>2,toggleToCntInv=>3}},
OffTimeMode =>{a=> 10.6,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"off time mode",lit=>{absolut=>0,minimal=>1}}, OffTimeMode =>{a=> 10.6,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"off time mode",lit=>{absolut=>0,minimal=>1}},
@ -356,7 +380,7 @@ my %culHmRegDefShLg = (# register that are available for short AND long button p
TempRC =>{a=> 45 ,s=>0.6,l=>3,min=>5 ,max=>30 ,c=>'' ,f=>2 ,u=>'C' ,d=>0,t=>"temperature repated to CtrlRc reg"}, TempRC =>{a=> 45 ,s=>0.6,l=>3,min=>5 ,max=>30 ,c=>'' ,f=>2 ,u=>'C' ,d=>0,t=>"temperature repated to CtrlRc reg"},
); );
my %culHmRegDefine = ( %culHmRegDefine = (
#--- list 0, device and protocol level----------------- #--- list 0, device and protocol level-----------------
burstRx =>{a=> 1.0,s=>1.0,l=>0,min=>0 ,max=>255 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>'device reacts on Burst' ,lit=>{off=>0,on=>1}}, burstRx =>{a=> 1.0,s=>1.0,l=>0,min=>0 ,max=>255 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>'device reacts on Burst' ,lit=>{off=>0,on=>1}},
intKeyVisib =>{a=> 2.7,s=>0.1,l=>0,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>'visibility of internal channel',lit=>{invisib=>0,visib=>1}}, intKeyVisib =>{a=> 2.7,s=>0.1,l=>0,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>'visibility of internal channel',lit=>{invisib=>0,visib=>1}},
@ -653,10 +677,10 @@ my %culHmRegDefine = (
#'blindActuatorSol' #'blindActuatorSol'
#'powerMeter' #'powerMeter'
my %culHmRegGeneral = ( %culHmRegGeneral = (
pairCentral=>1, pairCentral=>1,
); );
my %culHmRegType = ( %culHmRegType = (
swi =>{ peerNeedsBurst =>1,expectAES =>1}, swi =>{ peerNeedsBurst =>1,expectAES =>1},
remote =>{ peerNeedsBurst =>1,expectAES =>1,dblPress =>1,longPress =>1 remote =>{ peerNeedsBurst =>1,expectAES =>1,dblPress =>1,longPress =>1
,sign =>1 ,sign =>1
@ -725,7 +749,7 @@ my %culHmRegType = (
#clones - - - - - - - - - - - - - - - #clones - - - - - - - - - - - - - - -
$culHmRegType{pushButton} = $culHmRegType{remote}; $culHmRegType{pushButton} = $culHmRegType{remote};
my %culHmRegModel = ( %culHmRegModel = (
"HM-RC-12" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1}, "HM-RC-12" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1},
"HM-RC-19" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1,backAtCharge =>1,language =>1 "HM-RC-19" =>{ backAtKey =>1, backAtMotion =>1, backOnTime =>1,backAtCharge =>1,language =>1
,lcdSymb =>1, lcdLvlInterp =>1 ,lcdSymb =>1, lcdLvlInterp =>1
@ -888,7 +912,7 @@ $culHmRegModel{"HM-LC-SW4-BA-PCB"} = $culHmRegModel{"HM-LC-SW1-BA-PCB"};
$culHmRegModel{"HM-CC-RT-DN-BoM"} = $culHmRegModel{"HM-CC-RT-DN"}; $culHmRegModel{"HM-CC-RT-DN-BoM"} = $culHmRegModel{"HM-CC-RT-DN"};
my %culHmRegChan = (# if channelspecific then enter them here %culHmRegChan = (# if channelspecific then enter them here
"HM-CC-TC02" =>{ displayMode =>1,displayTemp =>1,displayTempUnit =>1 "HM-CC-TC02" =>{ displayMode =>1,displayTemp =>1,displayTempUnit =>1
,controlMode =>1,decalcDay =>1 ,controlMode =>1,decalcDay =>1
,"day-temp" =>1,"night-temp" =>1,"party-temp" =>1 ,"day-temp" =>1,"night-temp" =>1,"party-temp" =>1
@ -1003,39 +1027,39 @@ $culHmRegChan{"HM-TC-IT-WM-W-EU06"}= $culHmRegType{"HM-CC-RT-DN06"};
##############################---get---######################################## ##############################---get---########################################
#define gets - try use same names as for set #define gets - try use same names as for set
my %culHmGlobalGets = ( %culHmGlobalGets = (
param => "<param>", param => "<param>",
reg => "<addr> ... <list> <peer>", reg => "<addr> ... <list> <peer>",
regList => "", regList => "",
saveConfig => "<filename>", saveConfig => "<filename>",
); );
my %culHmSubTypeGets = ( %culHmSubTypeGets = (
none4Type =>{ "test"=>"" }, none4Type =>{ "test"=>"" },
); );
my %culHmModelGets = ( %culHmModelGets = (
none4Mod =>{ "none"=>"" }, none4Mod =>{ "none"=>"" },
); );
##############################---set---######################################## ##############################---set---########################################
my %culHmGlobalSets = (# all but virtuals %culHmGlobalSets = (# all but virtuals
regBulk => "<list>:<peer> <addr1:data1> <addr2:data2> ...", regBulk => "<list>:<peer> <addr1:data1> <addr2:data2> ...",
getRegRaw => "[List0|List1|List2|List3|List4|List5|List6] ... [<PeerChannel>]", getRegRaw => "[List0|List1|List2|List3|List4|List5|List6] ... [<PeerChannel>]",
getConfig => "", getConfig => "",
regSet => "[prep|exec] <regName> <value> ... [<peerChannel>]", regSet => "[prep|exec] <regName> <value> ... [<peerChannel>]",
clear => "[readings|register|rssi|msgEvents]", clear => "[readings|register|rssi|msgEvents]",
); );
my %culHmGlobalSetsVrtDev = (# virtuals and devices without subtype %culHmGlobalSetsVrtDev = (# virtuals and devices without subtype
raw => "data ...", raw => "data ...",
virtual =>"<noButtons>", virtual =>"<noButtons>",
); );
my %culHmGlobalSetsDevice = (# all devices but virtuals %culHmGlobalSetsDevice = (# all devices but virtuals
raw => "data ...", raw => "data ...",
reset => "", reset => "",
pair => "", pair => "",
unpair => "", unpair => "",
); );
my %culHmSubTypeDevSets = (# device of this subtype %culHmSubTypeDevSets = (# device of this subtype
switch =>{ statusRequest => "", switch =>{ statusRequest => "",
getSerial => ""}, getSerial => ""},
dimmer =>{ statusRequest => "", dimmer =>{ statusRequest => "",
@ -1054,11 +1078,11 @@ my %culHmSubTypeDevSets = (# device of this subtype
outputUnit =>{ statusRequest => ""},# also LED16? proof outputUnit =>{ statusRequest => ""},# also LED16? proof
); );
my %culHmGlobalSetsChn = (# all channels but virtuals %culHmGlobalSetsChn = (# all channels but virtuals
sign => "[on|off]", sign => "[on|off]",
peerBulk => "<peer1,peer2,...>", peerBulk => "<peer1,peer2,...>",
); );
my %culHmSubTypeSets = (# channels of this subtype %culHmSubTypeSets = (# channels of this subtype
switch =>{ "on-for-timer"=>"<sec>" switch =>{ "on-for-timer"=>"<sec>"
,"on-till" =>"<time>" ,"on-till" =>"<time>"
,on =>"" ,on =>""
@ -1093,7 +1117,7 @@ my %culHmSubTypeSets = (# channels of this subtype
threeStateSensor =>{ peerChan =>"<btnNumber> <actChn> ... single [set|unset] [actor|remote|both]" threeStateSensor =>{ peerChan =>"<btnNumber> <actChn> ... single [set|unset] [actor|remote|both]"
# ,statusRequest =>"" # ,statusRequest =>""
}, },
THSensor =>{ peerChan =>"<btnNumber> <actChn> ... single [set|unset] [actor|remote|both]"}, THSensor =>{ peerChan =>" 0 <actChn> ... single [set|unset] [actor|remote|both]"},
virtual =>{ peerChan =>"<btnNumber> <actChn> ... [single|dual] [set|unset] [actor|remote|both]" virtual =>{ peerChan =>"<btnNumber> <actChn> ... [single|dual] [set|unset] [actor|remote|both]"
,press =>"[long|short]..." ,press =>"[long|short]..."
,postEvent =>"<condition>" ,postEvent =>"<condition>"
@ -1128,7 +1152,7 @@ $culHmSubTypeSets{powerMeter} = $culHmSubTypeSets{outputUnit};
$culHmSubTypeSets{motionDetector} = $culHmSubTypeSets{threeStateSensor}; $culHmSubTypeSets{motionDetector} = $culHmSubTypeSets{threeStateSensor};
my %culHmModelSets = (# channels of this subtype------------- %culHmModelSets = (# channels of this subtype-------------
# "HM-CC-VD" =>{ valvePos => "position"}, # "HM-CC-VD" =>{ valvePos => "position"},
"HM-RC-19" =>{ service => "<count>" "HM-RC-19" =>{ service => "<count>"
,alarm => "<count>" ,alarm => "<count>"
@ -1158,7 +1182,7 @@ $culHmModelSets{"HM-RC-19-SW"} = $culHmModelSets{"HM-RC-19"};
$culHmModelSets{"HM-OU-CM-PCB"} = $culHmModelSets{"HM-OU-CFM-PL"}; $culHmModelSets{"HM-OU-CM-PCB"} = $culHmModelSets{"HM-OU-CFM-PL"};
#%{$culHmModelSets{"HM-RC-19-SW"}} = %{$culHmModelSets{"HM-RC-19"}}; copy #%{$culHmModelSets{"HM-RC-19-SW"}} = %{$culHmModelSets{"HM-RC-19"}}; copy
my %culHmChanSets = ( %culHmChanSets = (
"HM-CC-TC00" =>{ "desired-temp" =>"[on|off|6.0..30.0]" "HM-CC-TC00" =>{ "desired-temp" =>"[on|off|6.0..30.0]"
,statusRequest =>"" ,statusRequest =>""
,sysTime =>"" ,sysTime =>""
@ -1184,15 +1208,12 @@ my %culHmChanSets = (
"HM-OU-CFM-PL01" =>{ led =>"<color>[,<color>...] [<repeat>]"}, "HM-OU-CFM-PL01" =>{ led =>"<color>[,<color>...] [<repeat>]"},
"HM-OU-CFM-PL02" =>{ playTone =>"<MP3No>[,<MP3No>...] [<repeat>]"}, "HM-OU-CFM-PL02" =>{ playTone =>"<MP3No>[,<MP3No>...] [<repeat>]"},
"WDF-solar01" =>{ peerChan =>" 0 <actChn> ... single [set|unset] [actor|remote|both]"},
"HM-Sen-RD-O01" =>{ peerChan =>" 0 <actChn> ... single [set|unset] [actor|remote|both]"},
"HM-Sen-RD-O02" =>{ "on-for-timer" =>"<sec>" "HM-Sen-RD-O02" =>{ "on-for-timer" =>"<sec>"
,"on-till" =>"<time>" ,"on-till" =>"<time>"
,on =>"" ,on =>""
,off =>"" ,off =>""
,toggle =>""}, ,toggle =>""},
"HM-CC-RT-DN00" =>{ sysTime =>""}, "HM-CC-RT-DN00" =>{ sysTime =>""},
"HM-CC-RT-DN02" =>{ sysTime =>""},
"HM-CC-RT-DN04" =>{ controlMode =>"[auto|boost|day|night]" "HM-CC-RT-DN04" =>{ controlMode =>"[auto|boost|day|night]"
,controlManu =>"[on|off|5.0..30.0]" ,controlManu =>"[on|off|5.0..30.0]"
,controlParty =>"<temp> <startDate> <startTime> <enddate> <endTime>" ,controlParty =>"<temp> <startDate> <startTime> <enddate> <endTime>"
@ -1206,7 +1227,6 @@ my %culHmChanSets = (
,"desired-temp" =>"[on|off|5.0..30.0]" ,"desired-temp" =>"[on|off|5.0..30.0]"
,sysTime =>"" ,sysTime =>""
}, },
"HM-CC-RT-DN05" =>{ peerChan =>" 0 <actChn> ... [single] [set|unset] [actor|remote|both]"},
"HM-ES-PMSw1-Pl01" =>{ "on-for-timer" =>"<sec>" "HM-ES-PMSw1-Pl01" =>{ "on-for-timer" =>"<sec>"
,"on-till" =>"<time>" ,"on-till" =>"<time>"
,on =>"" ,on =>""
@ -1215,20 +1235,27 @@ my %culHmChanSets = (
,press =>"[long|short] [on|off] ..." ,press =>"[long|short] [on|off] ..."
,inhibit =>"[on|off]" ,inhibit =>"[on|off]"
,statusRequest =>""}, ,statusRequest =>""},
"HM-ES-PMSw1-Pl03" =>{ peerChan =>" 0 <actChn> ... [single] [set|unset] [actor|remote|both]"},
); );
# clones- - - - - - - - - - - - - - - - - # clones- - - - - - - - - - - - - - - - -
#$culHmChanSets{"HM-OU-CF-PL02"} = $culHmChanSets{"HM-OU-CF-PL01"}; #$culHmChanSets{"HM-OU-CF-PL02"} = $culHmChanSets{"HM-OU-CF-PL01"};
$culHmChanSets{"WDF-solar02"} = $culHmChanSets{"blindActuator"}; $culHmChanSets{"WDF-solar01"} = $culHmSubTypeSets{"THSensor"};
$culHmChanSets{"HM-Sen-RD-O01"} = $culHmSubTypeSets{"THSensor"};
$culHmChanSets{"HM-CC-RT-DN05"} = $culHmSubTypeSets{"THSensor"};
$culHmChanSets{"HM-ES-PMSw1-Pl03"} = $culHmSubTypeSets{"THSensor"};
$culHmChanSets{"WDF-solar02"} = $culHmSubTypeSets{"blindActuator"};
$culHmChanSets{"HM-CC-RT-DN02"} = $culHmChanSets{"HM-CC-RT-DN00"};
$culHmChanSets{"HM-CC-RT-DN-BoM00"}= $culHmChanSets{"HM-CC-RT-DN00"}; $culHmChanSets{"HM-CC-RT-DN-BoM00"}= $culHmChanSets{"HM-CC-RT-DN00"};
$culHmChanSets{"HM-CC-RT-DN-BoM02"}= $culHmChanSets{"HM-CC-RT-DN02"}; $culHmChanSets{"HM-CC-RT-DN-BoM02"}= $culHmChanSets{"HM-CC-RT-DN02"};
$culHmChanSets{"HM-CC-RT-DN-BoM04"}= $culHmChanSets{"HM-CC-RT-DN04"}; $culHmChanSets{"HM-CC-RT-DN-BoM04"}= $culHmChanSets{"HM-CC-RT-DN04"};
$culHmChanSets{"HM-CC-RT-DN-BoM05"}= $culHmChanSets{"HM-CC-RT-DN05"}; $culHmChanSets{"HM-CC-RT-DN-BoM05"}= $culHmChanSets{"HM-CC-RT-DN05"};
$culHmChanSets{"HM-ES-PMSw1-Pl04"} = $culHmChanSets{"HM-ES-PMSw1-Pl03"}; $culHmChanSets{"HM-ES-PMSw1-Pl04"} = $culHmChanSets{"HM-ES-PMSw1-Pl03"};
$culHmChanSets{"HM-ES-PMSw1-Pl05"} = $culHmChanSets{"HM-ES-PMSw1-Pl03"}; $culHmChanSets{"HM-ES-PMSw1-Pl05"} = $culHmChanSets{"HM-ES-PMSw1-Pl03"};
$culHmChanSets{"HM-ES-PMSw1-Pl06"} = $culHmChanSets{"HM-ES-PMSw1-Pl03"}; $culHmChanSets{"HM-ES-PMSw1-Pl06"} = $culHmChanSets{"HM-ES-PMSw1-Pl03"};
my %culHmFunctSets = (# command depending on function %culHmFunctSets = (# command depending on function
sdLead =>{ alarmOn =>"" sdLead =>{ alarmOn =>""
,alarmOff =>"" ,alarmOff =>""
,teamCall =>"" ,teamCall =>""
@ -1239,7 +1266,7 @@ my %culHmFunctSets = (# command depending on function
# RC send BCAST to specific address. Is the meaning understood? # RC send BCAST to specific address. Is the meaning understood?
my @culHmCmdFlags = ("WAKEUP", "WAKEMEUP", "CFG", "Bit3", @culHmCmdFlags = ("WAKEUP", "WAKEMEUP", "CFG", "Bit3",
"BURST", "BIDI", "RPTED", "RPTEN"); "BURST", "BIDI", "RPTED", "RPTEN");
#RPTEN 0x80: set in every message. Meaning? #RPTEN 0x80: set in every message. Meaning?
#RPTED 0x40: repeated (repeater operation) #RPTED 0x40: repeated (repeater operation)
@ -1251,7 +1278,7 @@ my @culHmCmdFlags = ("WAKEUP", "WAKEMEUP", "CFG", "Bit3",
#WAKEUP 0x01: send initially to keep the device awake #WAKEUP 0x01: send initially to keep the device awake
##############################---messages---################################### ##############################---messages---###################################
my %culHmBits = ( %culHmBits = (
"00" => { txt => "DEVICE_INFO", params => { "00" => { txt => "DEVICE_INFO", params => {
FIRMWARE => '00,2', FIRMWARE => '00,2',
TYPE => "02,4", TYPE => "02,4",
@ -1436,32 +1463,32 @@ my %culHmBits = (
HUM => '04,2,$val=(hex($val))', } }, HUM => '04,2,$val=(hex($val))', } },
); );
sub HMConfig_getHash($){ #sub HMConfig_getHash($){
my $hn = shift; # my $hn = shift;
return %culHmModel if($hn eq "culHmModel" ); # return %culHmModel if($hn eq "culHmModel" );
return %culHmRegDefShLg if($hn eq "culHmRegDefShLg" ); # return %culHmRegDefShLg if($hn eq "culHmRegDefShLg" );
return %culHmRegDefine if($hn eq "culHmRegDefine" ); # return %culHmRegDefine if($hn eq "culHmRegDefine" );
return %culHmRegGeneral if($hn eq "culHmRegGeneral" ); # return %culHmRegGeneral if($hn eq "culHmRegGeneral" );
return %culHmRegType if($hn eq "culHmRegType" ); # return %culHmRegType if($hn eq "culHmRegType" );
return %culHmRegModel if($hn eq "culHmRegModel" ); # return %culHmRegModel if($hn eq "culHmRegModel" );
return %culHmRegChan if($hn eq "culHmRegChan" ); # return %culHmRegChan if($hn eq "culHmRegChan" );
#
return %culHmGlobalGets if($hn eq "culHmGlobalGets" ); # return %culHmGlobalGets if($hn eq "culHmGlobalGets" );
return %culHmSubTypeGets if($hn eq "culHmSubTypeGets" ); # return %culHmSubTypeGets if($hn eq "culHmSubTypeGets" );
return %culHmModelGets if($hn eq "culHmModelGets" ); # return %culHmModelGets if($hn eq "culHmModelGets" );
#
return %culHmGlobalSetsDevice if($hn eq "culHmGlobalSetsDevice"); # return %culHmGlobalSetsDevice if($hn eq "culHmGlobalSetsDevice");
return %culHmSubTypeDevSets if($hn eq "culHmSubTypeDevSets" ); # return %culHmSubTypeDevSets if($hn eq "culHmSubTypeDevSets" );
return %culHmGlobalSetsChn if($hn eq "culHmGlobalSetsChn" ); # return %culHmGlobalSetsChn if($hn eq "culHmGlobalSetsChn" );
return %culHmGlobalSets if($hn eq "culHmGlobalSets" ); # return %culHmGlobalSets if($hn eq "culHmGlobalSets" );
return %culHmGlobalSetsVrtDev if($hn eq "culHmGlobalSetsVrtDev"); # return %culHmGlobalSetsVrtDev if($hn eq "culHmGlobalSetsVrtDev");
return %culHmSubTypeSets if($hn eq "culHmSubTypeSets" ); # return %culHmSubTypeSets if($hn eq "culHmSubTypeSets" );
return %culHmModelSets if($hn eq "culHmModelSets" ); # return %culHmModelSets if($hn eq "culHmModelSets" );
return %culHmChanSets if($hn eq "culHmChanSets" ); # return %culHmChanSets if($hn eq "culHmChanSets" );
return %culHmFunctSets if($hn eq "culHmFunctSets" ); # return %culHmFunctSets if($hn eq "culHmFunctSets" );
#
return %culHmBits if($hn eq "culHmBits" ); # return %culHmBits if($hn eq "culHmBits" );
return @culHmCmdFlags if($hn eq "culHmCmdFlags" ); # return @culHmCmdFlags if($hn eq "culHmCmdFlags" );
return $K_actDetID if($hn eq "K_actDetID" ); # return $K_actDetID if($hn eq "K_actDetID" );
} #}
1; 1;