Skip to content

Commit

Permalink
Add Thread Network Directory Cluster definition (#33683)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ksperling-apple authored and pull[bot] committed Jun 19, 2024
1 parent ae5ef65 commit 1490840
Show file tree
Hide file tree
Showing 57 changed files with 7,060 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Generally regenerate using one of:
| 1070 | 0x42E | TotalVolatileOrganicCompoundsConcentrationMeasurement |
| 1071 | 0x42F | RadonConcentrationMeasurement |
| 1105 | 0x451 | WiFiNetworkManagement |
| 1107 | 0x453 | ThreadNetworkDirectory |
| 1283 | 0x503 | WakeOnLan |
| 1284 | 0x504 | Channel |
| 1285 | 0x505 | TargetNavigator |
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<xi:include href="chip/thermostat-user-interface-configuration-cluster.xml" />
<xi:include href="chip/thermostat-cluster.xml" />
<xi:include href="chip/thread-network-diagnostics-cluster.xml" />
<xi:include href="chip/thread-network-directory-cluster.xml" />
<xi:include href="chip/time-format-localization-cluster.xml" />
<xi:include href="chip/time-synchronization-cluster.xml" />
<xi:include href="chip/timer-cluster.xml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2024 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configurator>
<domain name="CHIP"/>

<struct name="ThreadNetworkStruct">
<cluster code="0x0453"/>
<item name="ExtendedPanID" type="int64u"/>
<item name="NetworkName" type="char_string" length="16"/>
<item name="Channel" type="int16u"/>
</struct>

<cluster>
<domain>Network Infrastructure</domain>
<name>Thread Network Directory</name>
<code>0x0453</code>
<define>THREAD_NETWORK_DIRECTORY_CLUSTER</define>
<description>Manages the names and credentials of Thread networks visible to the user.</description>

<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>

<!-- cluster revision -->
<globalAttribute side="either" code="0xFFFD" value="1"/>

<attribute side="server" code="0x0000" define="PREFERRED_EXTENDED_PAN_ID" type="int64u" writable="true" isNullable="true" optional="false">
<description>PreferredExtendedPanID</description>
<access op="read" privilege="manage"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0001" define="THREAD_NETWORKS" type="array" entryType="ThreadNetworkStruct" writable="false" optional="false">
<description>ThreadNetworks</description>
<access op="read" privilege="operate"/>
</attribute>
<attribute side="server" code="0x0002" define="THREAD_NETWORK_TABLE_SIZE" type="int8u" writable="false" optional="false">ThreadNetworkTableSize</attribute>

<command source="client" code="0x00" name="AddNetwork" mustUseTimedInvoke="true" optional="false">
<description>Adds an entry to the ThreadNetworks list.</description>
<access op="invoke" privilege="manage"/>
<arg name="OperationalDataset" type="octet_string" length="254"/>
</command>
<command source="client" code="0x01" name="RemoveNetwork" mustUseTimedInvoke="true" optional="false">
<description>Removes an entry from the ThreadNetworks list.</description>
<access op="invoke" privilege="manage"/>
<arg name="ExtendedPanID" type="int64u"/>
</command>
<command source="client" code="0x02" name="GetOperationalDataset" mustUseTimedInvoke="true" optional="false" response="OperationalDatasetResponse">
<description>Retrieves a Thread Operational Dataset from the ThreadNetworks list.</description>
<access op="invoke" privilege="operate"/>
<arg name="ExtendedPanID" type="int64u"/>
</command>
<command source="server" code="0x03" name="OperationalDatasetResponse" optional="false">
<description>This is the response to a GetOperationalDataset request.</description>
<arg name="OperationalDataset" type="octet_string" length="254"/>
</command>

<event side="server" code="0x00" name="NetworkChanged" priority="info" optional="false">
<description>This event SHALL be generated when an entry in ThreadNetworks is added, removed, or had its Operational Dataset changed.</description>
<field id="0" name="ExtendedPanID" type="int64u"/>
<access op="read" privilege="operate"/>
</event>
</cluster>
</configurator>
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"thermostat-cluster.xml",
"thermostat-user-interface-configuration-cluster.xml",
"thread-network-diagnostics-cluster.xml",
"thread-network-directory-cluster.xml",
"time-format-localization-cluster.xml",
"time-synchronization-cluster.xml",
"timer-cluster.xml",
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"thermostat-cluster.xml",
"thermostat-user-interface-configuration-cluster.xml",
"thread-network-diagnostics-cluster.xml",
"thread-network-directory-cluster.xml",
"time-format-localization-cluster.xml",
"time-synchronization-cluster.xml",
"timer-cluster.xml",
Expand Down
1 change: 1 addition & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
"THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [
"thread-network-diagnostics-server"
],
"THREAD_NETWORK_DIRECTORY_CLUSTER": [],
"TIME_CLUSTER": [],
"TIME_FORMAT_LOCALIZATION_CLUSTER": ["time-format-localization-server"],
"TIME_SYNCHRONIZATION_CLUSTER": ["time-synchronization-server"],
Expand Down
48 changes: 48 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -7674,6 +7674,54 @@ cluster WiFiNetworkManagement = 1105 {
command access(invoke: administer) NetworkPassphraseRequest(): NetworkPassphraseResponse = 0;
}

/** Manages the names and credentials of Thread networks visible to the user. */
cluster ThreadNetworkDirectory = 1107 {
revision 1;

struct ThreadNetworkStruct {
int64u extendedPanID = 0;
char_string<16> networkName = 1;
int16u channel = 2;
}

info event access(read: operate) NetworkChanged = 0 {
int64u extendedPanID = 0;
}

attribute access(read: manage, write: manage) nullable int64u preferredExtendedPanID = 0;
readonly attribute access(read: operate) ThreadNetworkStruct threadNetworks[] = 1;
readonly attribute int8u threadNetworkTableSize = 2;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct AddNetworkRequest {
octet_string<254> operationalDataset = 0;
}

request struct RemoveNetworkRequest {
int64u extendedPanID = 0;
}

request struct GetOperationalDatasetRequest {
int64u extendedPanID = 0;
}

response struct OperationalDatasetResponse = 3 {
octet_string<254> operationalDataset = 0;
}

/** Adds an entry to the ThreadNetworks list. */
timed command access(invoke: manage) AddNetwork(AddNetworkRequest): DefaultSuccess = 0;
/** Removes an entry from the ThreadNetworks list. */
timed command access(invoke: manage) RemoveNetwork(RemoveNetworkRequest): DefaultSuccess = 1;
/** Retrieves a Thread Operational Dataset from the ThreadNetworks list. */
timed command GetOperationalDataset(GetOperationalDatasetRequest): OperationalDatasetResponse = 2;
}

/** This cluster provides an interface for managing low power mode on a device that supports the Wake On LAN protocol. */
cluster WakeOnLan = 1283 {
revision 1;
Expand Down
Loading

0 comments on commit 1490840

Please sign in to comment.