From 57ed5ffa5f84e8204bd948ff2473af976f9eda35 Mon Sep 17 00:00:00 2001 From: StefanStrobel <> Date: Mon, 12 Nov 2018 19:43:23 +0000 Subject: [PATCH] 98_PHC.pm: small changes git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@17737 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/98_PHC.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FHEM/98_PHC.pm b/FHEM/98_PHC.pm index 387bcd11a..b40d4987e 100755 --- a/FHEM/98_PHC.pm +++ b/FHEM/98_PHC.pm @@ -750,6 +750,7 @@ sub PHC_ParseFrames($) ($pld, $crc, $rest) = unpack ("a[$len]va*", $rest); # v = little endian unsigned short, n would be big endian @data = unpack ('C*', $pld); + $crc = 0 if (!$crc); $crc1 = crc($frame, 16, 0xffff, 0xffff, 1, 0x1021, 1, 0); my $fcrc = unpack ("H*", pack ("v", $crc)); my $fcrc1 = unpack ("H*", pack ("v", $crc1)); @@ -949,8 +950,10 @@ sub PHC_ReadAnswer($$$) sub PHC_Ready($) { my ($hash) = @_; - return DevIo_OpenDev($hash, 1, undef) - if($hash->{STATE} eq "disconnected"); + if ($hash->{STATE} eq "disconnected") { + $hash->{devioLoglevel} = (AttrVal($hash->{NAME}, "silentReconnect", 0) ? 4 : 3); + return DevIo_OpenDev($hash, 1, undef); + } # This is relevant for windows/USB only my $po = $hash->{USBDev}; @@ -997,7 +1000,7 @@ sub PHC_SplitCode($$$) sub PHC_LogCommand($$$$) { my ($hash, $command, $msg, $level) = @_; - Log3 $hash->{NAME}, $level, "$hash->{NAME}: " . PHC_Caller() . ' ' . PHC_CmdText($hash, $command) . $msg; + Log3 $hash->{NAME}, $level, "$hash->{NAME}: " . PHC_Caller() . ' ' . PHC_CmdText($hash, $command) . " $msg"; }