From 991a33c2ca2253c136e42a7b8a92ea30c8f60382 Mon Sep 17 00:00:00 2001 From: delmar <> Date: Sun, 13 Dec 2020 16:30:22 +0000 Subject: [PATCH] 70_DENON_AVR: serial connection issues git-svn-id: https://svn.fhem.de/fhem/trunk@23343 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/70_DENON_AVR.pm | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index c149086f8..1f31da5b3 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - bugfix: 70_DENON_AVR: serial connection issues - feature: 77_SMAEM: attr serialNumber may contain multiple serial numbers - feature: 57_SSCal: handle multiline code in description field if automatic creation of at-devices is used diff --git a/fhem/FHEM/70_DENON_AVR.pm b/fhem/FHEM/70_DENON_AVR.pm index efa8bc72e..edf836f52 100755 --- a/fhem/FHEM/70_DENON_AVR.pm +++ b/fhem/FHEM/70_DENON_AVR.pm @@ -1151,14 +1151,8 @@ DENON_AVR_Define($$) } - # connect using serial connection (old blocking style) - if ($hash->{DeviceName} =~ /^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}) (.+@.+)/) - { - my $ret = DevIo_OpenDev($hash, 0, "DENON_AVR_DoInit"); - return $ret; - } # connect using TCP connection (non-blocking style) - else + if ($hash->{DeviceName} =~ /^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})/) { $hash->{IP} = $a[2]; use XML::Simple qw(:strict); @@ -1166,15 +1160,19 @@ DENON_AVR_Define($$) $hash->{DeviceName} = $hash->{DeviceName} . ":23" if ( $hash->{DeviceName} !~ m/^(.+):([0-9]+)$/ ); - - DevIo_OpenDev( - $hash, 0, - "DENON_AVR_DoInit", - sub() { - my ( $hash, $err ) = @_; - Log3 $name, 4, "DENON_AVR $name: $err." if ($err); - } - ); + + my $ret = DevIo_OpenDev($hash, 0, "DENON_AVR_DoInit", + sub() { + my ( $hash, $err ) = @_; + Log3 $name, 4, "DENON_AVR $name: $err." if ($err); + }); + + return $ret; + } + # connect using serial connection (old blocking style) + else + { + DevIo_OpenDev($hash, 0, "DENON_AVR_DoInit"); } }