98_Modbus.pm: small logging change

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24146 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
StefanStrobel 2021-04-04 10:30:25 +00:00
parent c234238715
commit aed06108c1

View File

@ -272,7 +272,7 @@ BEGIN { # functions / variables needed from package main
};
my $Module_Version = '4.4.01 - 18.3.2021';
my $Module_Version = '4.4.02 - 31.3.2021';
my $PhysAttrs = join (' ',
'queueDelay',
@ -3464,7 +3464,9 @@ sub PackObj {
$counter++;
}
else {
local $SIG{__WARN__} = sub { Log3 $name, 3, "$name: PackObj pack for $objCombi value $val with code $unpack created warning: @_"; };
local $SIG{__WARN__} = sub { Log3 $name, 3, "$name: PackObj pack for $objCombi " .
(defined ($val) ? "value $val" : "undefined value") .
" $val with code $unpack created warning: @_"; };
my $dataPart = pack ($unpack, $val); # use unpack code, might create warnings
Log3 $name, 5, "$name: PackObj packed $val with pack code $unpack to " . unpack ('H*', $dataPart);
$dataPart = substr ($dataPart . pack ('x' . $len * 2, undef), 0, $len * 2);