Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize thread border router management xml template file and run zap_generate_all.py #33610

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/test-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml \
Expand Down
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 |
| 1106 | 0x452 | ThreadBorderRouterManagement |
| 1107 | 0x453 | ThreadNetworkDirectory |
| 1283 | 0x503 | WakeOnLan |
| 1284 | 0x504 | Channel |
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/temperature-measurement-clust
load "../src/app/zap-templates/zcl/data-model/chip/test-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml";
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 @@ -93,6 +93,7 @@
<xi:include href="chip/test-cluster.xml" />
<xi:include href="chip/thermostat-user-interface-configuration-cluster.xml" />
<xi:include href="chip/thermostat-cluster.xml" />
<xi:include href="chip/thread-border-router-management-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" />
Expand Down
15 changes: 15 additions & 0 deletions src/app/zap-templates/zcl/data-model/chip/matter-devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,21 @@ limitations under the License.
<include cluster="Wi-Fi Network Management" client="false" server="true" clientLocked="true" serverLocked="true"/>
</clusters>
</deviceType>
<deviceType>
<name>MA-thread-border-router</name>
<domain>HRAP</domain>
<typeName>Matter Thread Border Router</typeName>
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0091</deviceId>
<class>Simple</class>
<scope>Endpoint</scope>
<clusters lockOthers="true">
wqx6 marked this conversation as resolved.
Show resolved Hide resolved
<include cluster="Descriptor" client="false" server="true" clientLocked="true" serverLocked="true"/>
<include cluster="Thread Network Diagnostics" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Thread Border Router Management" client="false" server="true" clientLocked="true" serverLocked="true"></include>
</clusters>
</deviceType>

<deviceType>
<name>MA-all-clusters-app</name>
<domain>CHIP</domain>
Expand Down
wqx6 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?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"/>

<bitmap name="Feature" type="bitmap32">
<cluster code="0x0452"/>
<field name="PANChange" mask="0x1"/>
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
</bitmap>

<cluster>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cluseter must be marked as provisional.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcarmelveilleux could you please detail why you think this cluster should be marked as provisional?

<domain>HRAP</domain>
<name>Thread Border Router Management</name>
<code>0x0452</code>
<define>THREAD_BORDER_ROUTER_MANAGEMENT</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<description>Manage the Thread network of Thread Border Router</description>

<globalAttribute code="0xFFFD" side="either" value="1"/>

<attribute side="server" code="0x0000" define="BORDER_ROUTER_NAME" type="char_string" length="63">BorderRouterName</attribute>

<attribute side="server" code="0x0001" define="BORDER_AGENT_ID" type="octet_string">BorderAgentID</attribute>

<attribute side="server" code="0x0002" define="THREAD_VERSION" type="int16u">ThreadVersion</attribute>

<attribute side="server" code="0x0003" define="INTERFACE_ENABLED" type="boolean" default="0">InterfaceEnabled</attribute>

<attribute side="server" code="0x0005" define="ACTIVE_DATASET_TIMESTAMP" type="int64u" isNullable="true">ActiveDatasetTimestamp</attribute>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 4

Copy link
Contributor Author

@wqx6 wqx6 Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix it in #33872



<command source="client" code="0x00" name="GetActiveDatasetRequest" response="DatasetResponse" optional="false">
<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>
<access op="invoke" privilege="manage"/>
</command>

<command source="client" code="0x01" name="GetPendingDatasetRequest" response="DatasetResponse" optional="false">
<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>
<access op="invoke" privilege="manage"/>
</command>

<command source="server" code="0x03" name="DatasetResponse" optional="false">
<description>Generated response to GetActiveDatasetRequest or GetPendingDatasetRequest commands.</description>
<arg name="Dataset" type="octet_string" length="254"/>
</command>

<command source="client" code="0x04" name="SetActiveDatasetRequest" optional="false">
<description>Command to set or update the active Dataset of the Thread network to which the Border Router is connected.</description>
<arg name="ActiveDataset" type="octet_string" length="254"/>
<arg name="Breadcrumb" type="int64u" optional="true"/>
<access op="invoke" privilege="manage"/>
</command>

<command source="client" code="0x05" name="SetPendingDatasetRequest" optional="true">
Comment on lines +57 to +69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the commands to fill the "2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command IDs re-numbered the in spec PR#9305 to remove this gap.

<description>Command set or update the pending Dataset of the Thread network to which the Border Router is connected.</description>
<arg name="PendingDataset" type="octet_string" length="254"/>
<access op="invoke" privilege="manage"/>
</command>

</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 @@ -115,6 +115,7 @@
"test-cluster.xml",
"thermostat-cluster.xml",
"thermostat-user-interface-configuration-cluster.xml",
"thread-border-router-management-cluster.xml",
"thread-network-diagnostics-cluster.xml",
"thread-network-directory-cluster.xml",
"time-format-localization-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 @@ -113,6 +113,7 @@
"test-cluster.xml",
"thermostat-cluster.xml",
"thermostat-user-interface-configuration-cluster.xml",
"thread-border-router-management-cluster.xml",
"thread-network-diagnostics-cluster.xml",
"thread-network-directory-cluster.xml",
"time-format-localization-cluster.xml",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"TEMPERATURE_MEASUREMENT_CLUSTER": [],
"THERMOSTAT_CLUSTER": ["thermostat-client"],
"THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [],
"THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER": [],
"THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [],
"TIME_CLUSTER": [],
"TIME_FORMAT_LOCALIZATION_CLUSTER": [],
Expand Down Expand Up @@ -286,6 +287,7 @@
"THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [
"thermostat-user-interface-configuration-server"
],
"THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER": [],
"THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [
"thread-network-diagnostics-server"
],
Expand Down
43 changes: 43 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,49 @@ cluster WiFiNetworkManagement = 1105 {
command access(invoke: administer) NetworkPassphraseRequest(): NetworkPassphraseResponse = 0;
}

/** Manage the Thread network of Thread Border Router */
cluster ThreadBorderRouterManagement = 1106 {
revision 1;

bitmap Feature : bitmap32 {
kPANChange = 0x1;
}

readonly attribute char_string<63> borderRouterName = 0;
readonly attribute octet_string<254> borderAgentID = 1;
readonly attribute int16u threadVersion = 2;
readonly attribute boolean interfaceEnabled = 3;
readonly attribute nullable int64u activeDatasetTimestamp = 5;
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;

response struct DatasetResponse = 3 {
octet_string<254> dataset = 0;
}

request struct SetActiveDatasetRequestRequest {
octet_string<254> activeDataset = 0;
optional int64u breadcrumb = 1;
}

request struct SetPendingDatasetRequestRequest {
octet_string<254> pendingDataset = 0;
}

/** 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 */
command access(invoke: manage) GetActiveDatasetRequest(): DatasetResponse = 0;
/** 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 */
command access(invoke: manage) GetPendingDatasetRequest(): DatasetResponse = 1;
/** Command to set or update the active Dataset of the Thread network to which the Border Router is connected. */
command access(invoke: manage) SetActiveDatasetRequest(SetActiveDatasetRequestRequest): DefaultSuccess = 4;
/** Command set or update the pending Dataset of the Thread network to which the Border Router is connected. */
command access(invoke: manage) SetPendingDatasetRequest(SetPendingDatasetRequestRequest): DefaultSuccess = 5;
}

/** Manages the names and credentials of Thread networks visible to the user. */
cluster ThreadNetworkDirectory = 1107 {
revision 1;
Expand Down
100 changes: 100 additions & 0 deletions src/controller/data_model/controller-clusters.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,106 @@
}
]
},
{
"name": "Thread Border Router Management",
"code": 1106,
"mfgCode": null,
"define": "THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER",
"side": "client",
"enabled": 1,
"commands": [
{
"name": "GetActiveDatasetRequest",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "GetPendingDatasetRequest",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "DatasetResponse",
"code": 2,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "SetActiveDatasetRequest",
"code": 3,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "SetPendingDatasetRequest",
"code": 4,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "TopologyRequest",
wqx6 marked this conversation as resolved.
Show resolved Hide resolved
"code": 5,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "TopologyResponse",
"code": 6,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "client",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this ZAP file seems to be missing some attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other clusters in this controller zap file also ignores the attributes besides FeatureMap and ClusterRevision. Looks like we don't need the attributes in the client side zap file.

"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "client",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "Thread Network Diagnostics",
"code": 53,
Expand Down
Loading
Loading