Skip to content

Commit 923854b

Browse files
Add Thread Network Directory Cluster definition (#33683)
* Add Thread Network Directory Cluster definition * zap_regen_all * Use ExtendedPanID as per spec * zap_regen_all * Add mustUseTimedInvoke="true" to commands * zap_regen_all
1 parent 44526d2 commit 923854b

File tree

57 files changed

+7060
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+7060
-0
lines changed

docs/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Generally regenerate using one of:
113113
| 1070 | 0x42E | TotalVolatileOrganicCompoundsConcentrationMeasurement |
114114
| 1071 | 0x42F | RadonConcentrationMeasurement |
115115
| 1105 | 0x451 | WiFiNetworkManagement |
116+
| 1107 | 0x453 | ThreadNetworkDirectory |
116117
| 1283 | 0x503 | WakeOnLan |
117118
| 1284 | 0x504 | Channel |
118119
| 1285 | 0x505 | TargetNavigator |

src/app/zap-templates/zcl/data-model/all.xml

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
<xi:include href="chip/thermostat-user-interface-configuration-cluster.xml" />
9595
<xi:include href="chip/thermostat-cluster.xml" />
9696
<xi:include href="chip/thread-network-diagnostics-cluster.xml" />
97+
<xi:include href="chip/thread-network-directory-cluster.xml" />
9798
<xi:include href="chip/time-format-localization-cluster.xml" />
9899
<xi:include href="chip/time-synchronization-cluster.xml" />
99100
<xi:include href="chip/timer-cluster.xml" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2024 Project CHIP Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<configurator>
18+
<domain name="CHIP"/>
19+
20+
<struct name="ThreadNetworkStruct">
21+
<cluster code="0x0453"/>
22+
<item name="ExtendedPanID" type="int64u"/>
23+
<item name="NetworkName" type="char_string" length="16"/>
24+
<item name="Channel" type="int16u"/>
25+
</struct>
26+
27+
<cluster>
28+
<domain>Network Infrastructure</domain>
29+
<name>Thread Network Directory</name>
30+
<code>0x0453</code>
31+
<define>THREAD_NETWORK_DIRECTORY_CLUSTER</define>
32+
<description>Manages the names and credentials of Thread networks visible to the user.</description>
33+
34+
<client tick="false" init="false">true</client>
35+
<server tick="false" init="false">true</server>
36+
37+
<!-- cluster revision -->
38+
<globalAttribute side="either" code="0xFFFD" value="1"/>
39+
40+
<attribute side="server" code="0x0000" define="PREFERRED_EXTENDED_PAN_ID" type="int64u" writable="true" isNullable="true" optional="false">
41+
<description>PreferredExtendedPanID</description>
42+
<access op="read" privilege="manage"/>
43+
<access op="write" privilege="manage"/>
44+
</attribute>
45+
<attribute side="server" code="0x0001" define="THREAD_NETWORKS" type="array" entryType="ThreadNetworkStruct" writable="false" optional="false">
46+
<description>ThreadNetworks</description>
47+
<access op="read" privilege="operate"/>
48+
</attribute>
49+
<attribute side="server" code="0x0002" define="THREAD_NETWORK_TABLE_SIZE" type="int8u" writable="false" optional="false">ThreadNetworkTableSize</attribute>
50+
51+
<command source="client" code="0x00" name="AddNetwork" mustUseTimedInvoke="true" optional="false">
52+
<description>Adds an entry to the ThreadNetworks list.</description>
53+
<access op="invoke" privilege="manage"/>
54+
<arg name="OperationalDataset" type="octet_string" length="254"/>
55+
</command>
56+
<command source="client" code="0x01" name="RemoveNetwork" mustUseTimedInvoke="true" optional="false">
57+
<description>Removes an entry from the ThreadNetworks list.</description>
58+
<access op="invoke" privilege="manage"/>
59+
<arg name="ExtendedPanID" type="int64u"/>
60+
</command>
61+
<command source="client" code="0x02" name="GetOperationalDataset" mustUseTimedInvoke="true" optional="false" response="OperationalDatasetResponse">
62+
<description>Retrieves a Thread Operational Dataset from the ThreadNetworks list.</description>
63+
<access op="invoke" privilege="operate"/>
64+
<arg name="ExtendedPanID" type="int64u"/>
65+
</command>
66+
<command source="server" code="0x03" name="OperationalDatasetResponse" optional="false">
67+
<description>This is the response to a GetOperationalDataset request.</description>
68+
<arg name="OperationalDataset" type="octet_string" length="254"/>
69+
</command>
70+
71+
<event side="server" code="0x00" name="NetworkChanged" priority="info" optional="false">
72+
<description>This event SHALL be generated when an entry in ThreadNetworks is added, removed, or had its Operational Dataset changed.</description>
73+
<field id="0" name="ExtendedPanID" type="int64u"/>
74+
<access op="read" privilege="operate"/>
75+
</event>
76+
</cluster>
77+
</configurator>

src/app/zap-templates/zcl/zcl-with-test-extensions.json

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"thermostat-cluster.xml",
117117
"thermostat-user-interface-configuration-cluster.xml",
118118
"thread-network-diagnostics-cluster.xml",
119+
"thread-network-directory-cluster.xml",
119120
"time-format-localization-cluster.xml",
120121
"time-synchronization-cluster.xml",
121122
"timer-cluster.xml",

src/app/zap-templates/zcl/zcl.json

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"thermostat-cluster.xml",
115115
"thermostat-user-interface-configuration-cluster.xml",
116116
"thread-network-diagnostics-cluster.xml",
117+
"thread-network-directory-cluster.xml",
117118
"time-format-localization-cluster.xml",
118119
"time-synchronization-cluster.xml",
119120
"timer-cluster.xml",

src/app/zap_cluster_list.json

+1
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
"THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [
290290
"thread-network-diagnostics-server"
291291
],
292+
"THREAD_NETWORK_DIRECTORY_CLUSTER": [],
292293
"TIME_CLUSTER": [],
293294
"TIME_FORMAT_LOCALIZATION_CLUSTER": ["time-format-localization-server"],
294295
"TIME_SYNCHRONIZATION_CLUSTER": ["time-synchronization-server"],

src/controller/data_model/controller-clusters.matter

+48
Original file line numberDiff line numberDiff line change
@@ -7674,6 +7674,54 @@ cluster WiFiNetworkManagement = 1105 {
76747674
command access(invoke: administer) NetworkPassphraseRequest(): NetworkPassphraseResponse = 0;
76757675
}
76767676

7677+
/** Manages the names and credentials of Thread networks visible to the user. */
7678+
cluster ThreadNetworkDirectory = 1107 {
7679+
revision 1;
7680+
7681+
struct ThreadNetworkStruct {
7682+
int64u extendedPanID = 0;
7683+
char_string<16> networkName = 1;
7684+
int16u channel = 2;
7685+
}
7686+
7687+
info event access(read: operate) NetworkChanged = 0 {
7688+
int64u extendedPanID = 0;
7689+
}
7690+
7691+
attribute access(read: manage, write: manage) nullable int64u preferredExtendedPanID = 0;
7692+
readonly attribute access(read: operate) ThreadNetworkStruct threadNetworks[] = 1;
7693+
readonly attribute int8u threadNetworkTableSize = 2;
7694+
readonly attribute command_id generatedCommandList[] = 65528;
7695+
readonly attribute command_id acceptedCommandList[] = 65529;
7696+
readonly attribute event_id eventList[] = 65530;
7697+
readonly attribute attrib_id attributeList[] = 65531;
7698+
readonly attribute bitmap32 featureMap = 65532;
7699+
readonly attribute int16u clusterRevision = 65533;
7700+
7701+
request struct AddNetworkRequest {
7702+
octet_string<254> operationalDataset = 0;
7703+
}
7704+
7705+
request struct RemoveNetworkRequest {
7706+
int64u extendedPanID = 0;
7707+
}
7708+
7709+
request struct GetOperationalDatasetRequest {
7710+
int64u extendedPanID = 0;
7711+
}
7712+
7713+
response struct OperationalDatasetResponse = 3 {
7714+
octet_string<254> operationalDataset = 0;
7715+
}
7716+
7717+
/** Adds an entry to the ThreadNetworks list. */
7718+
timed command access(invoke: manage) AddNetwork(AddNetworkRequest): DefaultSuccess = 0;
7719+
/** Removes an entry from the ThreadNetworks list. */
7720+
timed command access(invoke: manage) RemoveNetwork(RemoveNetworkRequest): DefaultSuccess = 1;
7721+
/** Retrieves a Thread Operational Dataset from the ThreadNetworks list. */
7722+
timed command GetOperationalDataset(GetOperationalDatasetRequest): OperationalDatasetResponse = 2;
7723+
}
7724+
76777725
/** This cluster provides an interface for managing low power mode on a device that supports the Wake On LAN protocol. */
76787726
cluster WakeOnLan = 1283 {
76797727
revision 1;

0 commit comments

Comments
 (0)