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

register set bugfix for partial bytes

git-svn-id: https://svn.fhem.de/fhem/trunk@2395 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2012-12-30 19:01:15 +00:00
parent f032b307b0
commit cb172f6689

View File

@ -2110,10 +2110,13 @@ CUL_HM_Set($@)
my $addrData; my $addrData;
if ($dLen < 8){# fractional byte see whether we have stored the register if ($dLen < 8){# fractional byte see whether we have stored the register
#read full 8 bit!!! #read full 8 bit!!!
my $curVal = CUL_HM_getRegFromStore(CUL_HM_id2Name($dst.$lChn), my $rName = CUL_HM_id2Name($dst.$lChn);
$rName =~ s/_chn:.*//;
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 read current value for Bitfield - retrieve Data first"
if (!$curVal); if (!$curVal);
$curVal =~ s/set_//; # set is not relevant, we take it as given
$data = ($curVal & (~($mask<<$bit)))|($data<<$bit); $data = ($curVal & (~($mask<<$bit)))|($data<<$bit);
$addrData.=sprintf("%02X%02X",$addr,$data); $addrData.=sprintf("%02X%02X",$addr,$data);
} }