You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doc: Improved the documentation related to Matter code-gen.
The way of handling data model related code changed in Matter
a lot. Added advanced migration guide and updated the instruction
for creating cluster extension.
Signed-off-by: Kamil Kasperczyk <[email protected]>
The way you handle cluster extensions depends on whether the cluster that you want to extend is implemented using the code-driven approach or with ZAP-generated code.
805
+
806
+
If the cluster is implemented using the code-driven approach, you must inherit from this cluster delegate class and implement the methods to handle the customized part.
807
+
Then, you must unregister the original cluster delegate and register the customized one.
808
+
For example, if you want to extend the ``BasicInformation`` cluster, you need to implement it in the application code as follows:
809
+
810
+
* Inherit from the ``BasicInformationCluster`` class and override the methods to handle the customized part.
Before the |NCS| v3.2.0, the extended commands callback were handled by the ``emberAf...`` functions.
806
-
807
-
For example, if you want to extend the ``BasicInformation`` cluster with the ``ExtendedCommand`` command, you need to implement it in the application code as follows:
If the cluster is implemented with ZAP-generated code, you must implement the required extension callbacks by defining the appropriate ``emberAf...Callback`` functions, as described in the code examples and in the cluster XML.
947
+
For example, if you want to extend the ``LevelControl`` cluster with the ``ExtendedCommand`` command, you need to implement it in the application code as follows:
Copy file name to clipboardExpand all lines: doc/nrf/releases_and_maturity/migration/migration_guide_3.2.rst
+66-5Lines changed: 66 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,11 +104,72 @@ Matter
104
104
105
105
To build your custom board with Wi-Fi support, set both the :kconfig:option:`CONFIG_CHIP_WIFI` and :kconfig:option:`CONFIG_WIFI_NRF70` Kconfig options to ``y``.
106
106
107
-
* The :file:`zap-generated` directory now includes the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files.
108
-
The Matter build system gradually moves to the new approach of data model handling and does not auto-generate some bits of a code responsible for command handling anymore.
109
-
Invoking the ``west zap-generate`` command removes command handler implementations from the existing :file:`IMClusterCommandHandler.cpp` file.
110
-
To fix this, you must now manually create the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files, and implement the ``MatterClusterServerInitCallback`` and ``MatterClusterServerShutdownCallback`` callbacks to handle server initialization, shutdown, and Matter cluster commands.
111
-
Ensure that these callbacks contain your application's command handling logic as required.
107
+
* The Matter build system is transitioning to a code-driven approach for Data Model and Cluster configuration handling.
108
+
This approach assumes gradual replacement of the configuration based on the ZAP files and the ZAP-generated code, and handling the configuration in the source code.
109
+
This change has the following impacts:
110
+
111
+
* The :file:`zap-generated` directory now includes the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files.
112
+
Invoking the ``west zap-generate`` command removes command handler implementations from the existing :file:`IMClusterCommandHandler.cpp` file.
113
+
To fix this, you must now manually create the :file:`CodeDrivenCallback.h` and :file:`CodeDrivenInitShutdown.cpp` files, and implement the ``MatterClusterServerInitCallback`` and ``MatterClusterServerShutdownCallback`` callbacks to handle server initialization, shutdown, and Matter cluster commands.
114
+
Ensure that these callbacks contain your application's command handling logic.
115
+
* The code-driven approach is not yet fully implemented for all available clusters, but the coverage will be increasing and it is used for the newly created clusters.
116
+
The following clusters are already ported using the code-driven approach:
117
+
118
+
* Access Control
119
+
* Administrator Commissioning
120
+
* Basic Information
121
+
* Binding
122
+
* Boolean State
123
+
* Descriptor
124
+
* Diagnostic Logs
125
+
* Ethernet Network Diagnostics
126
+
* Fixed Label
127
+
* General Commissioning
128
+
* General Diagnostics
129
+
* Group Key Management
130
+
* Groupcast
131
+
* Identify
132
+
* Localization Configuration
133
+
* OTA Software Update Provider
134
+
* Operational Credentials
135
+
* Push AV Stream Transport
136
+
* Software Diagnostics
137
+
* Time Format Localization
138
+
* User Label
139
+
* Wi-Fi Network Diagnostics
140
+
141
+
For the full list of clusters and their migration status, see the `Matter Clusters Code-Driven support`_ file.
142
+
143
+
* By default, all the mandatory attributes are enabled for the cluster.
144
+
To enable an optional attribute or set an optional feature in the feature map, you must do that in the source code by calling dedicated methods.
145
+
For example, to enable the Positioning feature and the ``CountdownTime`` optional attribute for the Closure Control cluster, perform the following operations:
146
+
147
+
* Implement a delegate class for the Closure Control cluster.
148
+
See the :file:`samples/matter/closure/src/closure_control_endpoint.h` file for an example.
149
+
* Enable the attribute and set the feature on cluster initialization.
150
+
See the ``ClosureControlEndpoint::Init`` function in the :file:`samples/matter/closure/src/closure_control_endpoint.cpp` file for an example.
151
+
152
+
* To enable an optional cluster, you must register it in the source code by calling a dedicated method.
153
+
For example, to enable the Identify cluster, implement the following code:
* To enable a cluster extension for the cluster that is already implemented using the code-driven approach, you must inherit from this cluster delegate class and implement the methods to handle the customized part.
164
+
You also have to unregister the original cluster delegate and register the customized one.
165
+
For example, to enable a cluster extension for the Basic Information cluster, perform the following operations:
166
+
167
+
* Inherit from the ``BasicInformationCluster`` class and override the methods to handle the customized part.
168
+
See the :file:`samples/matter/manufacturer_specific/src/basic_information_extension.h` file for an example.
169
+
* Implement the body of overridden methods to handle the custom attributes, commands, and events.
170
+
See the :file:`samples/matter/manufacturer_specific/src/basic_information_extension.cpp` file for an example.
171
+
* Unregister the original cluster delegate and register the customized one.
172
+
See the ``AppTask::StartApp`` function in the :file:`samples/matter/manufacturer_specific/src/app_task.cpp` file for an example.
Copy file name to clipboardExpand all lines: doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -259,6 +259,7 @@ The Matter fork in the |NCS| (``sdk-connectedhomeip``) contains all commits from
259
259
* Added:
260
260
261
261
* Support for the following new device types:
262
+
262
263
* Irrigation System
263
264
* Soil Sensor
264
265
* Closure
@@ -284,10 +285,10 @@ The Matter fork in the |NCS| (``sdk-connectedhomeip``) contains all commits from
284
285
For example, to enable a specific cluster or its attribute, the new model requires calling a dedicated delegate and registering the cluster in a source code.
285
286
The code-driven approach is not yet fully implemented for all the available clusters, but the coverage will be increasing and it is used for the newly created clusters.
286
287
The new model is meant to be backward compatible with the previous configuration based on the ZAP files and the ZAP-generated code, until the code-driven approach is fully implemented for all the available clusters.
288
+
See the `Migration guide for nRF Connect SDK v3.2.0`_ for more information.
287
289
* The :ref:`ug_matter_gs_tools_matter_west_commands_sync` command to synchronize the ZAP and :file:`zcl.json` files after updating the ZAP tool version.
288
290
* The check to all :ref:`ug_matter_gs_tools_matter_west_commands_zap_tool` commands that verify whether ZAP tool sandbox permissions are correctly set.
289
291
In case of detecting incorrect permissions, the command will prompt the user to accept automatically updating the permissions to required ones.
290
-
291
292
* Updated:
292
293
293
294
* The :ref:`ug_matter_gs_tools_matter_west_commands_append` command to accept ``--clusters`` argument instead of ``new_clusters`` argument.
0 commit comments