2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

ZWave: fix MULTI_SENSOR decoding for slightly strange packets (Forum #25036)

git-svn-id: https://svn.fhem.de/fhem/trunk@6238 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-07-11 14:09:37 +00:00
parent 760cae9af1
commit c62af504e5

View File

@ -535,6 +535,7 @@ ZWave_ParseMultilevel($$$)
my $pr = (hex($fl)>>5)&0x07; # precision
my $sc = (hex($fl)>>3)&0x03; # scale
my $bc = (hex($fl)>>0)&0x07; # bytecount
$arg = substr($arg, 0, 2*$bc);
my $msb = (hex($arg)>>8*$bc-1); # most significant bit ( 0 = pos, 1 = neg )
my $val = $msb ? -( 2 ** (8 * $bc) - hex($arg) ) : hex($arg); # 2's complement
my $ml = $ml_tbl{$type};