mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-09 20:57:11 +00:00
10_WS980: v1.5.0 - fix fhem-crash when autodiscovery fails
git-svn-id: https://svn.fhem.de/fhem/trunk@24727 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
340a989b45
commit
b4b48bd6e1
@ -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: 10_WS980: v.1.5.0 fix fhem-crash when autodiscovery fails
|
||||
- change: 10_WS980: allow to ignore invalid values
|
||||
- feature: 49_SSCam: new value 8.2.8-xxxx for attr simu_SVSversion
|
||||
- bugfix: 76_SMAInverter:fix ETOTAL/LOADTOTAL bug
|
||||
|
@ -33,7 +33,7 @@ use warnings;
|
||||
use IO::Socket::INET;
|
||||
use POSIX qw(strftime);
|
||||
|
||||
my $version = "1.4.0";
|
||||
my $version = "1.5.0";
|
||||
|
||||
#------------------------------------------------------------------------------------------------------
|
||||
# global constants
|
||||
@ -451,10 +451,18 @@ sub WS980_autodiscoverIP($)
|
||||
WS980_Log($hash, 4, "received raw reply: " . WS980_hexDump($rawbuf));
|
||||
|
||||
my ($typeStr, $buf) = WS980_handleReply($hash, $rawbuf);
|
||||
my ($ip1, $ip2, $ip3, $ip4, $port, $stationName) = unpack("x[6]CCCCnC/A", $buf);
|
||||
WS980_Log($hash, 2, "reply: $ip1, $ip2, $ip3, $ip4, $port, $stationName");
|
||||
|
||||
return (sprintf("%d.%d.%d.%d", $ip1, $ip2, $ip3, $ip4), $port);
|
||||
if (defined($buf)) {
|
||||
my ($ip1, $ip2, $ip3, $ip4, $port, $stationName) = unpack("x[6]CCCCnC/A", $buf);
|
||||
WS980_Log($hash, 2, "autodiscovery-reply: $ip1, $ip2, $ip3, $ip4, $port, $stationName");
|
||||
|
||||
return (sprintf("%d.%d.%d.%d", $ip1, $ip2, $ip3, $ip4), $port);
|
||||
}
|
||||
else
|
||||
{
|
||||
WS980_Log($hash, 1, "autodiscovery failed: looks like the reply could not be decoded");
|
||||
return (undef,undef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user