mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
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:
parent
0fb1aed001
commit
5bb77c2007
@ -32,6 +32,8 @@ my %sets = (
|
||||
"sendNIF" => { cmd => "12%02x05@" },# ZW_SEND_NODE_INFORMATION
|
||||
"setNIF" => { cmd => "03%02x%02x%02x%02x" },
|
||||
# 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
|
||||
"reopen" => { cmd => "" },
|
||||
"backupCreate" => { cmd => "" },
|
||||
@ -48,9 +50,10 @@ my %gets = (
|
||||
"nodeInfo" => "41%02x", # ZW_GET_NODE_PROTOCOL_INFO
|
||||
"nodeList" => "02", # SERIAL_API_GET_INIT_DATA
|
||||
"random" => "1c%02x", # ZW_GET_RANDOM
|
||||
"version" => "15", # ZW_GET_VERSION
|
||||
"sucNodeId" => "56", # ZW_GET_SUC_NODE_ID
|
||||
"timeouts" => "06", # SERIAL_API_SET_TIMEOUTS
|
||||
"raw" => "%s", # hex
|
||||
"version" => "15", # ZW_GET_VERSION
|
||||
"raw" => "%s", # hex
|
||||
);
|
||||
|
||||
sub
|
||||
@ -390,6 +393,9 @@ ZWDongle_Get($@)
|
||||
$msg =~ s/^....//;
|
||||
$msg = zwlib_parseNeighborList($hash, $msg);
|
||||
|
||||
} elsif($cmd eq "sucNodeId") { ############################
|
||||
$msg = ($r[2]==0)?"no":hex($r[2])
|
||||
|
||||
}
|
||||
|
||||
$cmd .= "_".join("_", @a) if(@a);
|
||||
@ -620,7 +626,7 @@ ZWDongle_Read($@)
|
||||
if($msg =~ m/^0013(..)/);
|
||||
|
||||
last if(defined($local) && (!defined($regexp) || ($msg =~ m/$regexp/)));
|
||||
$hash->{PARTIAL} = $data; # Recursive call by ZWave get, Forum #37418
|
||||
$hash->{PARTIAL} = $data; # Recursive call by ZWave get, Forum #37418
|
||||
ZWDongle_Parse($hash, $name, $msg) if($init_done);
|
||||
|
||||
$data = $hash->{PARTIAL};
|
||||
@ -658,7 +664,7 @@ ZWDongle_ReadAnswer($$$)
|
||||
if($hash->{GotCAN}) {
|
||||
ZWDongle_ProcessSendStack($hash);
|
||||
next;
|
||||
}
|
||||
}
|
||||
return ("Timeout reading answer for get $arg", undef);
|
||||
}
|
||||
|
||||
@ -876,6 +882,12 @@ ZWDongle_Ready($)
|
||||
Replace a non-responding node with a new one. The non-responding node
|
||||
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>
|
||||
<br>
|
||||
|
||||
@ -912,6 +924,11 @@ ZWDongle_Ready($)
|
||||
|
||||
<li>raw<br>
|
||||
Send raw data to the controller. Developer only.</li>
|
||||
|
||||
<li>sucNodeId<br>
|
||||
return the currently registered SUC node ID.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
@ -954,6 +971,8 @@ ZWDongle_Ready($)
|
||||
</li>
|
||||
<li>ZW_REQUEST_NODE_NEIGHBOR_UPDATE [started|done|failed]
|
||||
</li>
|
||||
<li>ZW_SET_SUC_NODE_ID [setSucNodeOk|setSucNodefailed]
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
|
@ -3704,6 +3704,15 @@ ZWave_Parse($$@)
|
||||
DoTrigger($ioName, "$cmd $retval");
|
||||
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";
|
||||
return "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user