Skip to content

Commit ad9b5ba

Browse files
wqx6Alami-Amine
authored andcommitted
Initialize thread border router management xml template file and run zap_generate_all.py (project-chip#33610)
* Initialize thread border router management xml template file and run zap_generate_all.py * Update the xml file * remove some struct files * breadcrumb field in SetActiveDataset command should be optional * review changes * Change BorderAgentId to BorderAgentID
1 parent a299d8a commit ad9b5ba

Some content is hidden

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

50 files changed

+7339
-2
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
@@ -113,6 +113,7 @@ Generally regenerate using one of:
113113
| 1070 | 0x42E | TotalVolatileOrganicCompoundsConcentrationMeasurement |
114114
| 1071 | 0x42F | RadonConcentrationMeasurement |
115115
| 1105 | 0x451 | WiFiNetworkManagement |
116+
| 1106 | 0x452 | ThreadBorderRouterManagement |
116117
| 1107 | 0x453 | ThreadNetworkDirectory |
117118
| 1283 | 0x503 | WakeOnLan |
118119
| 1284 | 0x504 | Channel |

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/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/thread-network-directory-cluster.xml" />
9899
<xi:include href="chip/time-format-localization-cluster.xml" />

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

+15
Original file line numberDiff line numberDiff line change
@@ -2428,6 +2428,21 @@ limitations under the License.
24282428
<include cluster="Wi-Fi Network Management" client="false" server="true" clientLocked="true" serverLocked="true"/>
24292429
</clusters>
24302430
</deviceType>
2431+
<deviceType>
2432+
<name>MA-thread-border-router</name>
2433+
<domain>HRAP</domain>
2434+
<typeName>Matter Thread Border Router</typeName>
2435+
<profileId editable="false">0x0103</profileId>
2436+
<deviceId editable="false">0x0091</deviceId>
2437+
<class>Simple</class>
2438+
<scope>Endpoint</scope>
2439+
<clusters lockOthers="true">
2440+
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true"/>
2441+
<include cluster="Thread Network Diagnostics" client="false" server="true" clientLocked="true" serverLocked="true"></include>
2442+
<include cluster="Thread Border Router Management" client="false" server="true" clientLocked="true" serverLocked="true"></include>
2443+
</clusters>
2444+
</deviceType>
2445+
24312446
<deviceType>
24322447
<name>MA-all-clusters-app</name>
24332448
<domain>CHIP</domain>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
<cluster>
26+
<domain>HRAP</domain>
27+
<name>Thread Border Router Management</name>
28+
<code>0x0452</code>
29+
<define>THREAD_BORDER_ROUTER_MANAGEMENT</define>
30+
<client init="false" tick="false">true</client>
31+
<server init="false" tick="false">true</server>
32+
<description>Manage the Thread network of Thread Border Router</description>
33+
34+
<globalAttribute code="0xFFFD" side="either" value="1"/>
35+
36+
<attribute side="server" code="0x0000" define="BORDER_ROUTER_NAME" type="char_string" length="63">BorderRouterName</attribute>
37+
38+
<attribute side="server" code="0x0001" define="BORDER_AGENT_ID" type="octet_string">BorderAgentID</attribute>
39+
40+
<attribute side="server" code="0x0002" define="THREAD_VERSION" type="int16u">ThreadVersion</attribute>
41+
42+
<attribute side="server" code="0x0003" define="INTERFACE_ENABLED" type="boolean" default="0">InterfaceEnabled</attribute>
43+
44+
<attribute side="server" code="0x0005" define="ACTIVE_DATASET_TIMESTAMP" type="int64u" isNullable="true">ActiveDatasetTimestamp</attribute>
45+
46+
47+
<command source="client" code="0x00" name="GetActiveDatasetRequest" response="DatasetResponse" optional="false">
48+
<description>Command to request the active operational dataset of the Thread network to which the border router is connected. This command must be sent over a valid CASE session</description>
49+
<access op="invoke" privilege="manage"/>
50+
</command>
51+
52+
<command source="client" code="0x01" name="GetPendingDatasetRequest" response="DatasetResponse" optional="false">
53+
<description>Command to request the pending dataset of the Thread network to which the border router is connected. This command must be sent over a valid CASE session</description>
54+
<access op="invoke" privilege="manage"/>
55+
</command>
56+
57+
<command source="server" code="0x03" name="DatasetResponse" optional="false">
58+
<description>Generated response to GetActiveDatasetRequest or GetPendingDatasetRequest commands.</description>
59+
<arg name="Dataset" type="octet_string" length="254"/>
60+
</command>
61+
62+
<command source="client" code="0x04" name="SetActiveDatasetRequest" optional="false">
63+
<description>Command to set or update the active Dataset of the Thread network to which the Border Router is connected.</description>
64+
<arg name="ActiveDataset" type="octet_string" length="254"/>
65+
<arg name="Breadcrumb" type="int64u" optional="true"/>
66+
<access op="invoke" privilege="manage"/>
67+
</command>
68+
69+
<command source="client" code="0x05" name="SetPendingDatasetRequest" optional="true">
70+
<description>Command set or update the pending Dataset of the Thread network to which the Border Router is connected.</description>
71+
<arg name="PendingDataset" type="octet_string" length="254"/>
72+
<access op="invoke" privilege="manage"/>
73+
</command>
74+
75+
</cluster>
76+
</configurator>

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

+1
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
"thread-network-directory-cluster.xml",
120121
"time-format-localization-cluster.xml",

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

+1
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
"thread-network-directory-cluster.xml",
118119
"time-format-localization-cluster.xml",

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

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

7677+
/** Manage the Thread network of Thread Border Router */
7678+
cluster ThreadBorderRouterManagement = 1106 {
7679+
revision 1;
7680+
7681+
bitmap Feature : bitmap32 {
7682+
kPANChange = 0x1;
7683+
}
7684+
7685+
readonly attribute char_string<63> borderRouterName = 0;
7686+
readonly attribute octet_string<254> borderAgentID = 1;
7687+
readonly attribute int16u threadVersion = 2;
7688+
readonly attribute boolean interfaceEnabled = 3;
7689+
readonly attribute nullable int64u activeDatasetTimestamp = 5;
7690+
readonly attribute command_id generatedCommandList[] = 65528;
7691+
readonly attribute command_id acceptedCommandList[] = 65529;
7692+
readonly attribute event_id eventList[] = 65530;
7693+
readonly attribute attrib_id attributeList[] = 65531;
7694+
readonly attribute bitmap32 featureMap = 65532;
7695+
readonly attribute int16u clusterRevision = 65533;
7696+
7697+
response struct DatasetResponse = 3 {
7698+
octet_string<254> dataset = 0;
7699+
}
7700+
7701+
request struct SetActiveDatasetRequestRequest {
7702+
octet_string<254> activeDataset = 0;
7703+
optional int64u breadcrumb = 1;
7704+
}
7705+
7706+
request struct SetPendingDatasetRequestRequest {
7707+
octet_string<254> pendingDataset = 0;
7708+
}
7709+
7710+
/** Command to request the active operational dataset of the Thread network to which the border router is connected. This command must be sent over a valid CASE session */
7711+
command access(invoke: manage) GetActiveDatasetRequest(): DatasetResponse = 0;
7712+
/** Command to request the pending dataset of the Thread network to which the border router is connected. This command must be sent over a valid CASE session */
7713+
command access(invoke: manage) GetPendingDatasetRequest(): DatasetResponse = 1;
7714+
/** Command to set or update the active Dataset of the Thread network to which the Border Router is connected. */
7715+
command access(invoke: manage) SetActiveDatasetRequest(SetActiveDatasetRequestRequest): DefaultSuccess = 4;
7716+
/** Command set or update the pending Dataset of the Thread network to which the Border Router is connected. */
7717+
command access(invoke: manage) SetPendingDatasetRequest(SetPendingDatasetRequestRequest): DefaultSuccess = 5;
7718+
}
7719+
76777720
/** Manages the names and credentials of Thread networks visible to the user. */
76787721
cluster ThreadNetworkDirectory = 1107 {
76797722
revision 1;

src/controller/data_model/controller-clusters.zap

+100
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,106 @@
11801180
}
11811181
]
11821182
},
1183+
{
1184+
"name": "Thread Border Router Management",
1185+
"code": 1106,
1186+
"mfgCode": null,
1187+
"define": "THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER",
1188+
"side": "client",
1189+
"enabled": 1,
1190+
"commands": [
1191+
{
1192+
"name": "GetActiveDatasetRequest",
1193+
"code": 0,
1194+
"mfgCode": null,
1195+
"source": "client",
1196+
"isIncoming": 0,
1197+
"isEnabled": 1
1198+
},
1199+
{
1200+
"name": "GetPendingDatasetRequest",
1201+
"code": 1,
1202+
"mfgCode": null,
1203+
"source": "client",
1204+
"isIncoming": 0,
1205+
"isEnabled": 1
1206+
},
1207+
{
1208+
"name": "DatasetResponse",
1209+
"code": 2,
1210+
"mfgCode": null,
1211+
"source": "server",
1212+
"isIncoming": 0,
1213+
"isEnabled": 1
1214+
},
1215+
{
1216+
"name": "SetActiveDatasetRequest",
1217+
"code": 3,
1218+
"mfgCode": null,
1219+
"source": "client",
1220+
"isIncoming": 0,
1221+
"isEnabled": 1
1222+
},
1223+
{
1224+
"name": "SetPendingDatasetRequest",
1225+
"code": 4,
1226+
"mfgCode": null,
1227+
"source": "client",
1228+
"isIncoming": 0,
1229+
"isEnabled": 1
1230+
},
1231+
{
1232+
"name": "TopologyRequest",
1233+
"code": 5,
1234+
"mfgCode": null,
1235+
"source": "client",
1236+
"isIncoming": 0,
1237+
"isEnabled": 1
1238+
},
1239+
{
1240+
"name": "TopologyResponse",
1241+
"code": 6,
1242+
"mfgCode": null,
1243+
"source": "server",
1244+
"isIncoming": 0,
1245+
"isEnabled": 1
1246+
}
1247+
],
1248+
"attributes": [
1249+
{
1250+
"name": "FeatureMap",
1251+
"code": 65532,
1252+
"mfgCode": null,
1253+
"side": "client",
1254+
"type": "bitmap32",
1255+
"included": 1,
1256+
"storageOption": "RAM",
1257+
"singleton": 0,
1258+
"bounded": 0,
1259+
"defaultValue": "0",
1260+
"reportable": 1,
1261+
"minInterval": 1,
1262+
"maxInterval": 65534,
1263+
"reportableChange": 0
1264+
},
1265+
{
1266+
"name": "ClusterRevision",
1267+
"code": 65533,
1268+
"mfgCode": null,
1269+
"side": "client",
1270+
"type": "int16u",
1271+
"included": 1,
1272+
"storageOption": "RAM",
1273+
"singleton": 0,
1274+
"bounded": 0,
1275+
"defaultValue": "2",
1276+
"reportable": 1,
1277+
"minInterval": 0,
1278+
"maxInterval": 65344,
1279+
"reportableChange": 0
1280+
}
1281+
]
1282+
},
11831283
{
11841284
"name": "Thread Network Diagnostics",
11851285
"code": 53,

0 commit comments

Comments
 (0)