mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +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.
|
# 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: 10_WS980: v.1.5.0 fix fhem-crash when autodiscovery fails
|
||||||
- change: 10_WS980: allow to ignore invalid values
|
- change: 10_WS980: allow to ignore invalid values
|
||||||
- feature: 49_SSCam: new value 8.2.8-xxxx for attr simu_SVSversion
|
- feature: 49_SSCam: new value 8.2.8-xxxx for attr simu_SVSversion
|
||||||
- bugfix: 76_SMAInverter:fix ETOTAL/LOADTOTAL bug
|
- bugfix: 76_SMAInverter:fix ETOTAL/LOADTOTAL bug
|
||||||
|
@ -33,7 +33,7 @@ use warnings;
|
|||||||
use IO::Socket::INET;
|
use IO::Socket::INET;
|
||||||
use POSIX qw(strftime);
|
use POSIX qw(strftime);
|
||||||
|
|
||||||
my $version = "1.4.0";
|
my $version = "1.5.0";
|
||||||
|
|
||||||
#------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------
|
||||||
# global constants
|
# global constants
|
||||||
@ -451,11 +451,19 @@ sub WS980_autodiscoverIP($)
|
|||||||
WS980_Log($hash, 4, "received raw reply: " . WS980_hexDump($rawbuf));
|
WS980_Log($hash, 4, "received raw reply: " . WS980_hexDump($rawbuf));
|
||||||
|
|
||||||
my ($typeStr, $buf) = WS980_handleReply($hash, $rawbuf);
|
my ($typeStr, $buf) = WS980_handleReply($hash, $rawbuf);
|
||||||
|
|
||||||
|
if (defined($buf)) {
|
||||||
my ($ip1, $ip2, $ip3, $ip4, $port, $stationName) = unpack("x[6]CCCCnC/A", $buf);
|
my ($ip1, $ip2, $ip3, $ip4, $port, $stationName) = unpack("x[6]CCCCnC/A", $buf);
|
||||||
WS980_Log($hash, 2, "reply: $ip1, $ip2, $ip3, $ip4, $port, $stationName");
|
WS980_Log($hash, 2, "autodiscovery-reply: $ip1, $ip2, $ip3, $ip4, $port, $stationName");
|
||||||
|
|
||||||
return (sprintf("%d.%d.%d.%d", $ip1, $ip2, $ip3, $ip4), $port);
|
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