mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
10_ZWave.pm/00_ZWDongle.pm: neighborUpdate fixes (Forum #54574)
git-svn-id: https://svn.fhem.de/fhem/trunk@11765 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
095a9b53ee
commit
2848536545
@ -479,17 +479,26 @@ ZWDongle_NUCheck($$$$)
|
||||
if($isWrite) {
|
||||
return 0 if($msg !~ m/^0048/ || $hash->{calledFromNuCheck});
|
||||
push @nuStack, "$fn/$msg";
|
||||
if(@nuStack == 1) {
|
||||
InternalTimer(gettimeofday+20, sub { # ZME timeout is 9-11s
|
||||
ZWDongle_NUCheck($hash, undef, "0048xx23", 0); # simulate fail
|
||||
}, \@nuStack, 0);
|
||||
}
|
||||
return (@nuStack > 1);
|
||||
|
||||
} else {
|
||||
return if($msg !~ m/^0048..(..)$/ || $1 eq "21"); # 21: started
|
||||
shift @nuStack;
|
||||
RemoveInternalTimer(\@nuStack);
|
||||
return if(@nuStack == 0);
|
||||
|
||||
my @a = split("/", $nuStack[0]);
|
||||
$hash->{calledFromNuCheck} = 1;
|
||||
ZWDongle_Write($hash, $a[0], $a[1]);
|
||||
delete($hash->{calledFromNuCheck});
|
||||
InternalTimer(gettimeofday+20, sub {
|
||||
ZWDongle_NUCheck($hash, undef, "0048xx23", 0); # simulate fail
|
||||
}, \@nuStack, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3825,6 +3825,7 @@ ZWave_Parse($$@)
|
||||
|
||||
my $rawMsg = "CMD:$cmd ID:$id ARG:$arg"; # No fmt change, Forum #49165
|
||||
Log3 $ioName, 4, $rawMsg ." CB:$callbackid";
|
||||
my $hash = ZWave_callbackId($callbackid);
|
||||
|
||||
if($cmd eq 'ZW_ADD_NODE_TO_NETWORK' ||
|
||||
$cmd eq 'ZW_REMOVE_NODE_FROM_NETWORK') {
|
||||
@ -3864,7 +3865,7 @@ ZWave_Parse($$@)
|
||||
my ($type6,$classes) = ($1, $2);
|
||||
my $ret = ZWave_SetClasses($homeId, $id, $type6, $classes);
|
||||
|
||||
my $hash = $modules{ZWave}{defptr}{"$homeId $id"};
|
||||
$hash = $modules{ZWave}{defptr}{"$homeId $id"};
|
||||
if($hash) {
|
||||
if(!AttrVal($hash->{NAME}, "noWakeupForApplicationUpdate", 0)) { # 50090
|
||||
if(ZWave_isWakeUp($hash)) {
|
||||
@ -3914,7 +3915,6 @@ ZWave_Parse($$@)
|
||||
}
|
||||
|
||||
} elsif($cmd eq "ZW_SEND_DATA") { # 0013cb00....
|
||||
my $hash = ZWave_callbackId($callbackid);
|
||||
my %msg = ('00'=>'OK', '01'=>'NO_ACK', '02'=>'FAIL',
|
||||
'03'=>'NOT_IDLE', '04'=>'NOROUTE' );
|
||||
my $lmsg = ($msg{$id} ? $msg{$id} : "UNKNOWN_ERROR");
|
||||
@ -3950,6 +3950,10 @@ ZWave_Parse($$@)
|
||||
} elsif($id eq "23") { $evt = 'failed';
|
||||
} else { $evt = 'unknown'; # should never happen
|
||||
}
|
||||
if($hash) {
|
||||
readingsSingleUpdate($hash, "neighborUpdate", $evt, 1);
|
||||
return $hash->{NAME};
|
||||
}
|
||||
|
||||
} elsif($cmd eq "ZW_REMOVE_FAILED_NODE_ID") {
|
||||
if($id eq "00") { $evt = 'nodeOk';
|
||||
@ -4052,7 +4056,7 @@ ZWave_Parse($$@)
|
||||
$id = "$id$ep";
|
||||
$arg = sprintf("%02x$3", length($3)/2);
|
||||
}
|
||||
my $hash = $modules{ZWave}{defptr}{"$homeId $id"};
|
||||
$hash = $modules{ZWave}{defptr}{"$homeId $id"};
|
||||
$baseHash = $hash if(!$baseHash);
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user