Skip to content

Commit 41d35e6

Browse files
committed
Initialize thread border router management xml template file and run zap_generate_all.py
1 parent 3718e99 commit 41d35e6

File tree

66 files changed

+10967
-3
lines changed

Some content is hidden

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

66 files changed

+10967
-3
lines changed

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ jobs:
180180
src/app/zap-templates/zcl/data-model/chip/test-cluster.xml \
181181
src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml \
182182
src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml \
183+
src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml \
183184
src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml \
184185
src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml \
185186
src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml \

docs/zap_clusters.md

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Generally regenerate using one of:
112112
| 1069 | 0x42D | Pm10ConcentrationMeasurement |
113113
| 1070 | 0x42E | TotalVolatileOrganicCompoundsConcentrationMeasurement |
114114
| 1071 | 0x42F | RadonConcentrationMeasurement |
115+
| 1106 | 0x452 | ThreadBorderRouterManagement |
115116
| 1283 | 0x503 | WakeOnLan |
116117
| 1284 | 0x504 | Channel |
117118
| 1285 | 0x505 | TargetNavigator |

scripts/rules.matterlint

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/temperature-measurement-clust
8888
load "../src/app/zap-templates/zcl/data-model/chip/test-cluster.xml";
8989
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml";
9090
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml";
91+
load "../src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml";
9192
load "../src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml";
9293
load "../src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml";
9394
load "../src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml";

src/app/common/templates/config-data.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ CommandHandlerInterfaceOnlyClusters:
4040
- Device Energy Management Mode
4141
- Electrical Power Measurement
4242
- Electrical Energy Measurement
43+
- Thread Border Router Management
4344

4445
# We need a more configurable way of deciding which clusters have which init functions....
4546
# See https://github.com/project-chip/connectedhomeip/issues/4369

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

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<xi:include href="chip/test-cluster.xml" />
9494
<xi:include href="chip/thermostat-user-interface-configuration-cluster.xml" />
9595
<xi:include href="chip/thermostat-cluster.xml" />
96+
<xi:include href="chip/thread-border-router-management-cluster.xml" />
9697
<xi:include href="chip/thread-network-diagnostics-cluster.xml" />
9798
<xi:include href="chip/time-format-localization-cluster.xml" />
9899
<xi:include href="chip/time-synchronization-cluster.xml" />

src/app/zap-templates/zcl/data-model/chip/matter-devices.xml

+15
Original file line numberDiff line numberDiff line change
@@ -2427,6 +2427,21 @@ limitations under the License.
24272427
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true"/>
24282428
</clusters>
24292429
</deviceType>
2430+
<deviceType>
2431+
<name>MA-thread-border-router</name>
2432+
<domain>HRAP</domain>
2433+
<typeName>Matter Thread Border Router</typeName>
2434+
<profileId editable="false">0x0103</profileId>
2435+
<deviceId editable="false">0xFFF10011</deviceId><!-- TODO: ID-TBD -->
2436+
<class>Simple</class>
2437+
<scope>Endpoint</scope>
2438+
<clusters lockOthers="true">
2439+
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true"/>
2440+
<include cluster="Thread Network Diagnostics" client="false" server="true" clientLocked="true" serverLocked="true"></include>
2441+
<include cluster="Thread Border Router Mangement" client="false" server="true" clientLocked="true" serverLocked="true"></include>
2442+
</clusters>
2443+
</deviceType>
2444+
24302445
<deviceType>
24312446
<name>MA-all-clusters-app</name>
24322447
<domain>CHIP</domain>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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+
<bitmap name="Feature" type="bitmap32">
21+
<cluster code="0x0452"/>
22+
<field name="PANChange" mask="0x1"/>
23+
</bitmap>
24+
25+
<enum name="RoutingRoleEnum" type="enum8">
26+
<cluster code="0x0452"/>
27+
<item name="Unspecified" value="0x00"/>
28+
<item name="Unassigned" value="0x01"/>
29+
<item name="SleepyEndDevice" value="0x02"/>
30+
<item name="EndDevice" value="0x03"/>
31+
<item name="REED" value="0x04"/>
32+
<item name="Router" value="0x05"/>
33+
<item name="Leader" value="0x06"/>
34+
</enum>
35+
36+
<struct name="NeiborTableStruct">
37+
<cluster code="0x0452"/>
38+
<item fieldId="0" name="ExtAddress" type="int64u"/>
39+
<item fieldId="1" name="Age" type="int32u"/>
40+
<item fieldId="2" name="Rloc16" type="int16u"/>
41+
<item fieldId="3" name="AverageRssi" type="int8s" isNullable="true"/>
42+
<item fieldId="4" name="LastRssi" type="int8s" isNullable="true"/>
43+
<item fieldId="5" name="RoutingRole" type="RoutingRoleEnum"/>
44+
</struct>
45+
46+
<struct name="RouteTableStruct">
47+
<cluster code="0x0452"/>
48+
<item fieldId="0" name="RouterId" type="int8u"/>
49+
<item fieldId="1" name="PathCost" type="int8u"/>
50+
<item fieldId="2" name="LQIIn" type="int8u"/>
51+
<item fieldId="3" name="LQIOut" type="int8u"/>
52+
</struct>
53+
54+
<struct name="ChildTableStruct">
55+
<cluster code="0x0452"/>
56+
<item fieldId="0" name="Rloc16" type="int16u"/>
57+
<item fieldId="1" name="LinkQuality" type="int8u"/>
58+
<item fieldId="2" name="RoutingRole" type="RoutingRoleEnum"/>
59+
</struct>
60+
61+
<struct name="ThreadNodeStruct">
62+
<cluster code="0x0452"/>
63+
<item fieldId="0" name="ExtAddress" type="int64u"/>
64+
<item fieldId="1" name="Rloc16" type="int16u"/>
65+
<item fieldId="2" name="IPv6s" type="octet_string" array="true"/>
66+
<item fieldId="3" name="RoutingRole" type="RoutingRoleEnum"/>
67+
<item fieldId="4" name="RouteTable" type="RouteTableStruct" array="true"/>
68+
<item fieldId="5" name="ChildTable" type="ChildTableStruct" array="true"/>
69+
</struct>
70+
71+
<cluster>
72+
<domain>HRAP</domain>
73+
<name>Thread Border Router Management</name>
74+
<code>0x0452</code>
75+
<define>THREAD_BORDER_ROUTER_MANAGEMENT</define>
76+
<client init="false" tick="false">true</client>
77+
<server init="false" tick="false">true</server>
78+
<description>Thread BR management</description>
79+
80+
<globalAttribute code="0xFFFD" side="either" value="1"/>
81+
82+
<attribute side="server" code="0x0000" define="BORDER_ROUTER_NAME" type="char_string" length="63">BorderRouterName</attribute>
83+
84+
<attribute side="server" code="0x0001" define="BORDER_AGENT_ID" type="octet_string" length="16">BorderAgentId</attribute>
85+
86+
<attribute side="server" code="0x0002" define="THREAD_VERSION" type="int16u">ThreadVersion</attribute>
87+
88+
<attribute side="server" code="0x0003" define="INTERFACE_ENABLED" type="boolean">InterfaceEnabled</attribute>
89+
90+
<attribute side="server" code="0x0004" define="THREAD_NODE" type="ThreadNodeStruct">ThreadNode</attribute>
91+
92+
<attribute side="server" code="0x0005" define="ACTIVE_DATASET_TIMESTAMP" type="int64u" isNullable="true">ActiveDatasetTimestamp</attribute>
93+
94+
95+
<command source="client" code="0x00" name="GetActiveDatasetRequest" response="DatasetResponse" optional="false">
96+
<description>On receipt of this command, the Thread Border Router will read the active operational dataset of the Thread network that it is connaected to, and send the DatasetResponse as the response. This command must be sent over a valid CASE session</description>
97+
<access op="invoke" privilege="manage"/>
98+
</command>
99+
100+
<command source="client" code="0x01" name="GetPendingDatasetRequest" response="DatasetResponse" optional="false">
101+
<description>On receipt of this command, the Thread Border Router will read the pending dataset and send the DatasetResponse as the response. This command must be sent over a valid CASE session</description>
102+
<access op="invoke" privilege="manage"/>
103+
</command>
104+
105+
<command source="server" code="0x02" name="DatasetResponse" optional="false">
106+
<description>Generated response to GetActiveDatasetRequest or GetPendingDatasetRequest commands</description>
107+
<arg name="Dataset" type="octet_string" length="254"/>
108+
</command>
109+
110+
<command source="client" code="0x03" name="SetActiveDatasetRequest" optional="false">
111+
<description>On receipt of this command, the Thread Border Router will set or update the active Dataset of the Thread network that the Stub Router is connected to.</description>
112+
<arg name="ActiveDataset" type="octet_string" length="254"/>
113+
<arg name="Breadcrumb" type="int64u"/>
114+
<access op="invoke" privilege="manage"/>
115+
</command>
116+
117+
<command source="client" code="0x04" name="SetPendingDatasetRequest" optional="true">
118+
<description>On receipt of this command, the Thread Border Router will set or update the pending Dataset</description>
119+
<arg name="PendingDataset" type="octet_string" length="254"/>
120+
<access op="invoke" privilege="manage"/>
121+
</command>
122+
123+
<command source="client" code="0x05" name="TopologyRequest" response="TopologyResponse" optional="false">
124+
<description>On receipt of this command, the Thread Border Router will response the current topology of the Thread network that it is connected to.</description>
125+
<arg name="Count" type="int16u"/>
126+
<arg name="StartIndex" type="int16u"/>
127+
<arg name="Snapshot" type="int8u"/>
128+
<access op="invoke" privilege="administer"/>
129+
</command>
130+
131+
<command source="server" code="0x06" name="TopologyResponse" optional="false">
132+
<description>Generated response to TopologyRequest command</description>
133+
<arg name="Status" type="status"/>
134+
<arg name="Snapshot" type="int8u"/>
135+
<arg name="NumberOfDevices" type="int16u"/>
136+
<arg name="ThreadTopology" type="ThreadNodeStruct" array="true"/>
137+
</command>
138+
139+
</cluster>
140+
</configurator>

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

+10
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"test-cluster.xml",
116116
"thermostat-cluster.xml",
117117
"thermostat-user-interface-configuration-cluster.xml",
118+
"thread-border-router-management-cluster.xml",
118119
"thread-network-diagnostics-cluster.xml",
119120
"time-format-localization-cluster.xml",
120121
"time-synchronization-cluster.xml",
@@ -289,6 +290,15 @@
289290
"general_error_boolean",
290291
"cluster_error_boolean"
291292
],
293+
"Thread Border Router Management": [
294+
"BorderRouterName",
295+
"BorderAgentId",
296+
"ThreadVersion",
297+
"InterfaceEnabled",
298+
"ThreadNode",
299+
"ActiveDatasetTimestamp",
300+
"FeatureMap"
301+
],
292302
"Thread Network Diagnostics": [
293303
"Channel",
294304
"RoutingRole",

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

+10
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"test-cluster.xml",
114114
"thermostat-cluster.xml",
115115
"thermostat-user-interface-configuration-cluster.xml",
116+
"thread-border-router-management-cluster.xml",
116117
"thread-network-diagnostics-cluster.xml",
117118
"time-format-localization-cluster.xml",
118119
"time-synchronization-cluster.xml",
@@ -287,6 +288,15 @@
287288
"general_error_boolean",
288289
"cluster_error_boolean"
289290
],
291+
"Thread Border Router Management": [
292+
"BorderRouterName",
293+
"BorderAgentId",
294+
"ThreadVersion",
295+
"InterfaceEnabled",
296+
"ThreadNode",
297+
"ActiveDatasetTimestamp",
298+
"FeatureMap"
299+
],
290300
"Thread Network Diagnostics": [
291301
"Channel",
292302
"RoutingRole",

src/app/zap_cluster_list.json

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"TEMPERATURE_MEASUREMENT_CLUSTER": [],
115115
"THERMOSTAT_CLUSTER": ["thermostat-client"],
116116
"THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [],
117+
"THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER": [],
117118
"THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [],
118119
"TIME_CLUSTER": [],
119120
"TIME_FORMAT_LOCALIZATION_CLUSTER": [],
@@ -286,6 +287,7 @@
286287
"THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [
287288
"thermostat-user-interface-configuration-server"
288289
],
290+
"THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER": [],
289291
"THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [
290292
"thread-network-diagnostics-server"
291293
],

src/controller/data_model/controller-clusters.matter

+100
Original file line numberDiff line numberDiff line change
@@ -7654,6 +7654,106 @@ cluster RadonConcentrationMeasurement = 1071 {
76547654
readonly attribute int16u clusterRevision = 65533;
76557655
}
76567656

7657+
/** Thread BR management */
7658+
cluster ThreadBorderRouterManagement = 1106 {
7659+
revision 1;
7660+
7661+
enum RoutingRoleEnum : enum8 {
7662+
kUnspecified = 0;
7663+
kUnassigned = 1;
7664+
kSleepyEndDevice = 2;
7665+
kEndDevice = 3;
7666+
kREED = 4;
7667+
kRouter = 5;
7668+
kLeader = 6;
7669+
}
7670+
7671+
bitmap Feature : bitmap32 {
7672+
kPANChange = 0x1;
7673+
}
7674+
7675+
struct ChildTableStruct {
7676+
int16u rloc16 = 0;
7677+
int8u linkQuality = 1;
7678+
RoutingRoleEnum routingRole = 2;
7679+
}
7680+
7681+
struct RouteTableStruct {
7682+
int8u routerId = 0;
7683+
int8u pathCost = 1;
7684+
int8u LQIIn = 2;
7685+
int8u LQIOut = 3;
7686+
}
7687+
7688+
struct ThreadNodeStruct {
7689+
int64u extAddress = 0;
7690+
int16u rloc16 = 1;
7691+
octet_string IPv6s[] = 2;
7692+
RoutingRoleEnum routingRole = 3;
7693+
RouteTableStruct routeTable[] = 4;
7694+
ChildTableStruct childTable[] = 5;
7695+
}
7696+
7697+
struct NeiborTableStruct {
7698+
int64u extAddress = 0;
7699+
int32u age = 1;
7700+
int16u rloc16 = 2;
7701+
nullable int8s averageRssi = 3;
7702+
nullable int8s lastRssi = 4;
7703+
RoutingRoleEnum routingRole = 5;
7704+
}
7705+
7706+
readonly attribute char_string<63> borderRouterName = 0;
7707+
readonly attribute octet_string<16> borderAgentId = 1;
7708+
readonly attribute int16u threadVersion = 2;
7709+
readonly attribute boolean interfaceEnabled = 3;
7710+
readonly attribute ThreadNodeStruct threadNode = 4;
7711+
readonly attribute nullable int64u activeDatasetTimestamp = 5;
7712+
readonly attribute command_id generatedCommandList[] = 65528;
7713+
readonly attribute command_id acceptedCommandList[] = 65529;
7714+
readonly attribute event_id eventList[] = 65530;
7715+
readonly attribute attrib_id attributeList[] = 65531;
7716+
readonly attribute bitmap32 featureMap = 65532;
7717+
readonly attribute int16u clusterRevision = 65533;
7718+
7719+
response struct DatasetResponse = 2 {
7720+
octet_string<254> dataset = 0;
7721+
}
7722+
7723+
request struct SetActiveDatasetRequestRequest {
7724+
octet_string<254> activeDataset = 0;
7725+
int64u breadcrumb = 1;
7726+
}
7727+
7728+
request struct SetPendingDatasetRequestRequest {
7729+
octet_string<254> pendingDataset = 0;
7730+
}
7731+
7732+
request struct TopologyRequestRequest {
7733+
int16u count = 0;
7734+
int16u startIndex = 1;
7735+
int8u snapshot = 2;
7736+
}
7737+
7738+
response struct TopologyResponse = 6 {
7739+
status status = 0;
7740+
int8u snapshot = 1;
7741+
int16u numberOfDevices = 2;
7742+
ThreadNodeStruct threadTopology[] = 3;
7743+
}
7744+
7745+
/** On receipt of this command, the Thread Border Router will read the active operational dataset of the Thread network that it is connaected to, and send the DatasetResponse as the response. This command must be sent over a valid CASE session */
7746+
command access(invoke: manage) GetActiveDatasetRequest(): DatasetResponse = 0;
7747+
/** On receipt of this command, the Thread Border Router will read the pending dataset and send the DatasetResponse as the response. This command must be sent over a valid CASE session */
7748+
command access(invoke: manage) GetPendingDatasetRequest(): DatasetResponse = 1;
7749+
/** On receipt of this command, the Thread Border Router will set or update the active Dataset of the Thread network that the Stub Router is connected to. */
7750+
command access(invoke: manage) SetActiveDatasetRequest(SetActiveDatasetRequestRequest): DefaultSuccess = 3;
7751+
/** On receipt of this command, the Thread Border Router will set or update the pending Dataset */
7752+
command access(invoke: manage) SetPendingDatasetRequest(SetPendingDatasetRequestRequest): DefaultSuccess = 4;
7753+
/** On receipt of this command, the Thread Border Router will response the current topology of the Thread network that it is connected to. */
7754+
command access(invoke: administer) TopologyRequest(TopologyRequestRequest): TopologyResponse = 5;
7755+
}
7756+
76577757
/** This cluster provides an interface for managing low power mode on a device that supports the Wake On LAN protocol. */
76587758
cluster WakeOnLan = 1283 {
76597759
revision 1;

0 commit comments

Comments
 (0)