2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 01:46:08 +00:00

10_ZWave.pm: add NO_ACK reporting. (Forum #33203)

git-svn-id: https://svn.fhem.de/fhem/trunk@7862 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-02-03 21:46:45 +00:00
parent f8f7659d7e
commit e77d4c2b11

View File

@ -486,6 +486,10 @@ ZWave_Cmd($$@)
return ($type eq "get" && AttrVal($name,"verbose",3) > 2 ?
"Scheduled for sending after WAKEUP" : undef);
}
} else {
$data .= $id if($type eq "set"); # callback=>id
}
IOWrite($hash, "00", $data);
@ -950,17 +954,23 @@ ZWave_Parse($$@)
return $ret;
} elsif($cmd eq "ZW_SEND_DATA") {
my $hash = $modules{ZWave}{defptr}{"$homeId $callbackid"};
my %msg = ('00'=>'OK', '01'=>'NO_ACK', '02'=>'FAIL',
'03'=>'NOT_IDLE', '04'=>'NOROUTE' );
my $msg = ($msg{$id} ? $msg{$id} : "UNKNOWN_ERROR");
if ($id eq "00") {
ZWave_HandleSendStack($iodev);
Log3 $ioName, 4,
"$ioName OK: SEND_DATA returned $id - TRANSMIT_COMPLETE_OK";
Log3 $ioName, 4, "$ioName transmit $msg for $callbackid";
readingsSingleUpdate($hash, "transmit", $msg, 0);
return "";
} else {
my %err = { "01" => "NO_ACK", "02" => "FAIL",
"03" => "NOT_IDLE", "04" => "NOROUTE" };
my $msg = $err{$id} ? "TRANSMIT_COMPLETE_".$err{$id} : "UNKOWN_ERROR";
Log3 $ioName, 2, "$ioName ERROR: SEND_DATA returned $id - $msg";
Log3 $ioName, 2, "$ioName transmit $msg for $callbackid";
return "" if(!$hash);
readingsSingleUpdate($hash, "state", "TRANSMIT_$msg", 1);
readingsSingleUpdate($hash, "transmit", $msg, 1);
return $hash->{NAME};
}
return "";
} elsif($cmd eq "ZW_REQUEST_NODE_NEIGHBOR_UPDATE") {
if ($id eq "21") {