ZWDongle/ZWave: add SUC/SIS capabilities by krikan (Forum #53066)

git-svn-id: https://svn.fhem.de/fhem/trunk@11399 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-05-06 06:32:49 +00:00
parent 0fb1aed001
commit 5bb77c2007
2 changed files with 114 additions and 86 deletions

View File

@ -32,6 +32,8 @@ my %sets = (
"sendNIF" => { cmd => "12%02x05@" },# ZW_SEND_NODE_INFORMATION "sendNIF" => { cmd => "12%02x05@" },# ZW_SEND_NODE_INFORMATION
"setNIF" => { cmd => "03%02x%02x%02x%02x" }, "setNIF" => { cmd => "03%02x%02x%02x%02x" },
# SERIAL_API_APPL_NODE_INFORMATION # SERIAL_API_APPL_NODE_INFORMATION
"sucNodeId" => { cmd => "54%02x%02x25%02x@"},
# ZW_SET_SUC_NODE_ID
"timeouts" => { cmd => "06%02x%02x" }, # SERIAL_API_SET_TIMEOUTS "timeouts" => { cmd => "06%02x%02x" }, # SERIAL_API_SET_TIMEOUTS
"reopen" => { cmd => "" }, "reopen" => { cmd => "" },
"backupCreate" => { cmd => "" }, "backupCreate" => { cmd => "" },
@ -48,8 +50,9 @@ my %gets = (
"nodeInfo" => "41%02x", # ZW_GET_NODE_PROTOCOL_INFO "nodeInfo" => "41%02x", # ZW_GET_NODE_PROTOCOL_INFO
"nodeList" => "02", # SERIAL_API_GET_INIT_DATA "nodeList" => "02", # SERIAL_API_GET_INIT_DATA
"random" => "1c%02x", # ZW_GET_RANDOM "random" => "1c%02x", # ZW_GET_RANDOM
"version" => "15", # ZW_GET_VERSION "sucNodeId" => "56", # ZW_GET_SUC_NODE_ID
"timeouts" => "06", # SERIAL_API_SET_TIMEOUTS "timeouts" => "06", # SERIAL_API_SET_TIMEOUTS
"version" => "15", # ZW_GET_VERSION
"raw" => "%s", # hex "raw" => "%s", # hex
); );
@ -390,6 +393,9 @@ ZWDongle_Get($@)
$msg =~ s/^....//; $msg =~ s/^....//;
$msg = zwlib_parseNeighborList($hash, $msg); $msg = zwlib_parseNeighborList($hash, $msg);
} elsif($cmd eq "sucNodeId") { ############################
$msg = ($r[2]==0)?"no":hex($r[2])
} }
$cmd .= "_".join("_", @a) if(@a); $cmd .= "_".join("_", @a) if(@a);
@ -876,6 +882,12 @@ ZWDongle_Ready($)
Replace a non-responding node with a new one. The non-responding node Replace a non-responding node with a new one. The non-responding node
must be on the failed Node list.</li> must be on the failed Node list.</li>
<li>sucNodeId [nodeId] [sucState] [capabilities]<br>
Configure a Controller Node to be a SUC/SIS or not.
[nodeId] to be SUC/SIS
[sucState] 0 = deactivate; 1 = activate
[capabilities] 0 = basic SUC 1 = SIS</li>
</ul> </ul>
<br> <br>
@ -912,6 +924,11 @@ ZWDongle_Ready($)
<li>raw<br> <li>raw<br>
Send raw data to the controller. Developer only.</li> Send raw data to the controller. Developer only.</li>
<li>sucNodeId<br>
return the currently registered SUC node ID.
</li>
</ul> </ul>
<br> <br>
@ -954,6 +971,8 @@ ZWDongle_Ready($)
</li> </li>
<li>ZW_REQUEST_NODE_NEIGHBOR_UPDATE [started|done|failed] <li>ZW_REQUEST_NODE_NEIGHBOR_UPDATE [started|done|failed]
</li> </li>
<li>ZW_SET_SUC_NODE_ID [setSucNodeOk|setSucNodefailed]
</li>
</ul> </ul>
</ul> </ul>

View File

@ -3704,6 +3704,15 @@ ZWave_Parse($$@)
DoTrigger($ioName, "$cmd $retval"); DoTrigger($ioName, "$cmd $retval");
return ""; return "";
} }
if($cmd eq "ZW_SET_SUC_NODE_ID") {
my $retval;
if($arg eq "00") { $retval = 'setSucNodeFailed';
} elsif($arg eq "01") { $retval = 'setSucNodeOk';
} else { $retval = 'unknown_'.$arg; # should never happen
}
DoTrigger($ioName, "$cmd $retval");
return "";
}
Log3 $ioName, 4, "$ioName unhandled ANSWER: $cmd $arg"; Log3 $ioName, 4, "$ioName unhandled ANSWER: $cmd $arg";
return ""; return "";