mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
MAXLAN: add additional cube bits to readings
git-svn-id: https://svn.fhem.de/fhem/trunk@4225 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
99139736ef
commit
ffbd6a3b13
@ -631,12 +631,11 @@ MAXLAN_Parse($$)
|
|||||||
my $unkbit1 = vec($bits1,0,1);
|
my $unkbit1 = vec($bits1,0,1);
|
||||||
my $initialized = vec($bits1,1,1); #I never saw this beeing 0
|
my $initialized = vec($bits1,1,1); #I never saw this beeing 0
|
||||||
my $answer = vec($bits1,2,1); #answer to what?
|
my $answer = vec($bits1,2,1); #answer to what?
|
||||||
my $rferror1 = vec($bits1,3,1); # if 1 then see errframetype
|
my $error = vec($bits1,3,1); # if 1 then see errframetype
|
||||||
my $valid = vec($bits1,4,1); #is the status following the common header valid
|
my $valid = vec($bits1,4,1); #is the status following the common header valid
|
||||||
my $unkbit2 = vec($bits1,5,1);
|
my $unkbit2 = vec($bits1,5,3);
|
||||||
my $unkbit3 = vec($bits1,6,2);
|
|
||||||
|
|
||||||
Log 5, "len $len, addr $addr, initialized $initialized, valid $valid, rferror $rferror1, errframetype $errframetype, answer $answer, unkbit ($unkbit1,$unkbit2,$unkbit3)";
|
Log 5, "len $len, addr $addr, initialized $initialized, valid $valid, error $error, errframetype $errframetype, answer $answer, unkbit ($unkbit1,$unkbit2)";
|
||||||
|
|
||||||
my $payload = unpack("H*",substr($bindata,6,$len-6+1)); #+1 because the len field is not counted
|
my $payload = unpack("H*",substr($bindata,6,$len-6+1)); #+1 because the len field is not counted
|
||||||
if($valid) {
|
if($valid) {
|
||||||
@ -658,6 +657,18 @@ MAXLAN_Parse($$)
|
|||||||
} else {
|
} else {
|
||||||
Dispatch($hash, "MAX,1,Error,$addr,Error $errframetype in Msg type L", {});
|
Dispatch($hash, "MAX,1,Error,$addr,Error $errframetype in Msg type L", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $dhash = $modules{MAX}{defptr}{$addr};
|
||||||
|
if(defined($dhash)) {
|
||||||
|
readingsBeginUpdate($dhash);
|
||||||
|
readingsBulkUpdate($dhash, "MAXLAN_initialized", $initialized);
|
||||||
|
readingsBulkUpdate($dhash, "MAXLAN_error", $error);
|
||||||
|
readingsBulkUpdate($dhash, "MAXLAN_errorType", $errframetype);
|
||||||
|
readingsBulkUpdate($dhash, "MAXLAN_valid", $valid);
|
||||||
|
readingsBulkUpdate($dhash, "MAXLAN_isAnswer", $answer);
|
||||||
|
readingsEndUpdate($dhash, 1);
|
||||||
|
}
|
||||||
|
|
||||||
$bindata=substr($bindata,$len+1); #+1 because the len field is not counted
|
$bindata=substr($bindata,$len+1); #+1 because the len field is not counted
|
||||||
} # while(length($bindata))
|
} # while(length($bindata))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user