mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
47_OBIS: fixed bug with 64 bit integer numbers
git-svn-id: https://svn.fhem.de/fhem/trunk@24113 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
034db039e0
commit
e4033b7995
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: 47_OBIS: fixed bug with 64 bit integer numbers
|
||||||
- change: 46_TeslaPowerwall2AC: Code rewrite for new Auth API and
|
- change: 46_TeslaPowerwall2AC: Code rewrite for new Auth API and
|
||||||
modul structure
|
modul structure
|
||||||
- new: 69_SoftliqCloud: New Module
|
- new: 69_SoftliqCloud: New Module
|
||||||
|
@ -417,13 +417,25 @@ sub OBIS_Parse_List
|
|||||||
} elsif ($tltype == 0x50 || $tltype == 0x60) {
|
} elsif ($tltype == 0x50 || $tltype == 0x60) {
|
||||||
# Signed (5) or Unsigned (6) Int
|
# Signed (5) or Unsigned (6) Int
|
||||||
my $num = 0;
|
my $num = 0;
|
||||||
|
my $subme = 0;
|
||||||
if ($tltype==0x60 && $len>3 && $result[0]=~/^1-0:16\.7\.0/ && $hash->{helper}{DZGHACK}) {
|
if ($tltype==0x60 && $len>3 && $result[0]=~/^1-0:16\.7\.0/ && $hash->{helper}{DZGHACK}) {
|
||||||
$tltype = 0x50;
|
$tltype = 0x50;
|
||||||
}
|
}
|
||||||
$num = ord chop($_[3]) if ($len--);
|
if ($len==8) {
|
||||||
my $subme = ($tltype == 0x50) && ($num & 0x80) ? ( 1 << (8*($len+1)) ) : 0;
|
$num = unpack($tltype = 0x50 ? 'q>' : 'Q>',
|
||||||
while ($len-- > 0) {
|
chop($_[3]).chop($_[3]).chop($_[3]).chop($_[3]).
|
||||||
$num = ($num<<8) | ord chop($_[3]);
|
chop($_[3]).chop($_[3]).chop($_[3]).chop($_[3]));
|
||||||
|
} elsif ($len==4) {
|
||||||
|
$num = unpack($tltype = 0x50 ? 'l>' : 'L>',
|
||||||
|
chop($_[3]).chop($_[3]).chop($_[3]).chop($_[3]));
|
||||||
|
} elsif ($len<8) {
|
||||||
|
$num = ord chop($_[3]) if ($len--);
|
||||||
|
$subme = ($tltype == 0x50) && ($num & 0x80) ? ( 1 << (8*($len+1)) ) : 0;
|
||||||
|
while ($len-- > 0) {
|
||||||
|
$num = ($num<<8) | ord chop($_[3]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log3 $hash, 1, "OBIS - Number sized over 8 bytes - no support implemented yet";
|
||||||
}
|
}
|
||||||
push @result, ($num-$subme);
|
push @result, ($num-$subme);
|
||||||
} elsif ($tltype == 0x40) {
|
} elsif ($tltype == 0x40) {
|
||||||
|
Loading…
Reference in New Issue
Block a user