2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-19 12:46:03 +00:00

type in HMLAN, autoreadreg correction for channels

git-svn-id: https://svn.fhem.de/fhem/trunk@3034 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-04-05 06:28:53 +00:00
parent e84ab09433
commit 5df83af260
2 changed files with 4 additions and 3 deletions

View File

@ -250,7 +250,7 @@ sub HMLAN_Parse($$) {##########################################################
my $srcId = (length($mFld[5])>11)?$src:"lastRec"; my $srcId = (length($mFld[5])>11)?$src:"lastRec";
$hash->{helper}{nextSend}{$srcId} = gettimeofday() + 0.100; $hash->{helper}{nextSend}{$srcId} = gettimeofday() + 0.100;
if ($debug){ if ($debug){
Log $ll5, 'HMLAN_Pars1: '.$name.' S:'.$mFld[0] Log $ll5, 'HMLAN_Parse: '.$name.' S:'.$mFld[0]
.(($mFld[0] =~ m/^E/)?' ':'') .(($mFld[0] =~ m/^E/)?' ':'')
.' stat:'.$mFld[1] .' stat:'.$mFld[1]
.' t:'.$mFld[2].' d:'.$mFld[3] .' t:'.$mFld[2].' d:'.$mFld[3]

View File

@ -115,7 +115,7 @@ sub CUL_HM_autoReadConfig($){
while(@{$modules{CUL_HM}{helper}{updtCfgLst}}){ while(@{$modules{CUL_HM}{helper}{updtCfgLst}}){
my $name = shift(@{$modules{CUL_HM}{helper}{updtCfgLst}}); my $name = shift(@{$modules{CUL_HM}{helper}{updtCfgLst}});
my $hash = CUL_HM_name2Hash($name); my $hash = CUL_HM_name2Hash($name);
if (0 != substr(AttrVal($name,"autoReadReg","0"),0,1)){ if (0 != substr(CUL_HM_Get($hash,$name,"param","autoReadReg"),0,1)){
CUL_HM_Set($hash,$name,"getSerial"); CUL_HM_Set($hash,$name,"getSerial");
CUL_HM_Set($hash,$name,"getConfig"); CUL_HM_Set($hash,$name,"getConfig");
CUL_HM_Set($hash,$name,"statusRequest"); CUL_HM_Set($hash,$name,"statusRequest");
@ -1527,6 +1527,7 @@ sub CUL_HM_queueAutoRead($){
my @arr; my @arr;
@arr = CUL_HM_noDup((@{$modules{CUL_HM}{helper}{updtCfgLst}}, $name)); @arr = CUL_HM_noDup((@{$modules{CUL_HM}{helper}{updtCfgLst}}, $name));
$modules{CUL_HM}{helper}{updtCfgLst} =\@arr; $modules{CUL_HM}{helper}{updtCfgLst} =\@arr;
Log 1,"General queued $name :".join "-",$modules{CUL_HM}{helper}{updtCfgLst};
RemoveInternalTimer("updateConfig"); RemoveInternalTimer("updateConfig");
InternalTimer(gettimeofday()+5,"CUL_HM_autoReadConfig", "updateConfig", 0); InternalTimer(gettimeofday()+5,"CUL_HM_autoReadConfig", "updateConfig", 0);
} }
@ -2004,7 +2005,7 @@ sub CUL_HM_Set($@) {
$rName =~ s/_chn:.*//; $rName =~ s/_chn:.*//;
my $curVal = CUL_HM_getRegFromStore($rName, my $curVal = CUL_HM_getRegFromStore($rName,
$addr,$list,$peerId.$peerChn); $addr,$list,$peerId.$peerChn);
return "cannot read current value for Bitfield - retrieve Data first" return "cannot calculate value. Please issue set $name getConfig first"
if (!$curVal ||$curVal eq "invalid"); if (!$curVal ||$curVal eq "invalid");
$curVal =~ s/set_//; # set is not relevant, we take it as given $curVal =~ s/set_//; # set is not relevant, we take it as given
$data = ($curVal & (~($mask<<$bit)))|($data<<$bit); $data = ($curVal & (~($mask<<$bit)))|($data<<$bit);