<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Failedto customize Cluster as per document</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121007/failedto-customize-cluster-as-per-document</link><description>Hello, Nordic Team! I followed this document and used the XML file mentioned in the document. custom_clusters 
 I did regenerate the files under the zap-generated folder, but the ExtendedCommandResponse in MyCluster.xml was not generated, which caused</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Apr 2025 11:53:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121007/failedto-customize-cluster-as-per-document" /><item><title>RE: Failedto customize Cluster as per document</title><link>https://devzone.nordicsemi.com/thread/533380?ContentTypeID=1</link><pubDate>Tue, 29 Apr 2025 11:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:189de0f5-ef90-4b1f-b28a-f1478f6d8a26</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for the feedback. I have forwarded it internally.&lt;/p&gt;
&lt;p&gt;You say that you fixed these issues on your side, but since this is a public ticket, I will provide instructions on how to fix them in case anyone else finds this ticket.&lt;/p&gt;
&lt;p&gt;I assume the errors you got were due to missing implementations of functions for the custom cluster and the Basic Cluster Extended Command generated by the ZAP tool. At least when I tested, I saw undefined references to these functions.&lt;/p&gt;
&lt;p&gt;To fix this, create the file zcl_callbacks.cpp in the src directory (if one does not already exist) and add the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2025 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

 #include &amp;lt;lib/support/logging/CHIPLogging.h&amp;gt;

#include &amp;quot;app_task.h&amp;quot;
#include &amp;quot;board/board.h&amp;quot;

#include &amp;lt;zap-generated/PluginApplicationCallbacks.h&amp;gt;
#include &amp;lt;app-common/zap-generated/callback.h&amp;gt;
#include &amp;lt;app-common/zap-generated/attributes/Accessors.h&amp;gt;
#include &amp;lt;app/ConcreteAttributePath.h&amp;gt;

using namespace ::chip;
using namespace ::chip::app;
using namespace ::chip::app::Clusters;
using namespace ::chip::app::Clusters::MyNewCluster::Commands;
using namespace ::chip::app::Clusters::BasicInformation::Commands;


bool emberAfMyNewClusterClusterMyCommandCallback(CommandHandler *commandObj,
						     const ConcreteCommandPath &amp;amp;commandPath,
						     const MyCommand::DecodableType &amp;amp;commandData)
{
	/* Intentionally empty */
	return true;
}


void MatterMyNewClusterPluginServerInitCallback()
{
	/* Intentionally empty */
}

/** @brief MyNewCluster Cluster Init
 *
 * This function is called when a specific cluster is initialized. It gives the
 * application an opportunity to take care of cluster initialization procedures.
 * It is called exactly once for each endpoint where cluster is present.
 *
 * @param endpoint   Ver.: always
 *
 */
void emberAfMyNewClusterClusterInitCallback(EndpointId endpoint)
{
    /* Intentionally empty */
}


bool emberAfBasicInformationClusterExtendedCommandCallback(CommandHandler *commandObj,
                             const ConcreteCommandPath &amp;amp;commandPath,
                             const ExtendedCommand::DecodableType &amp;amp; /* unused */)
{
    /* Intentionally empty */
    return true;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Make sure also to add this file to target_sources in CMakeLists.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;target_sources(app PRIVATE
    src/app_task.cpp
    src/zcl_callbacks.cpp
    src/main.cpp
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please note that I have left the functions empty, so this only fixes the build issue. To implement these functions, I recommend looking at other Matter samples, such as the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.0.0/page/nrf/samples/matter/manufacturer_specific/README.html"&gt;manufacturer-specific&lt;/a&gt; sample.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failedto customize Cluster as per document</title><link>https://devzone.nordicsemi.com/thread/533287?ContentTypeID=1</link><pubDate>Tue, 29 Apr 2025 02:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3759dfc-e8c9-41a3-be45-3b050854ce1e</guid><dc:creator>xiongwei.wang</dc:creator><description>&lt;p&gt;Thank you, Marte. Additionally, I need to point out that the tutorial I mentioned earlier doesn&amp;#39;t seem to provide complete steps. Compilation results in some errors, which are easy to fix, but if Nordic could provide explanations in the documentation, it would greatly help developers. Regardless, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failedto customize Cluster as per document</title><link>https://devzone.nordicsemi.com/thread/533214?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 13:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78658717-129e-4727-be53-36e8eca31c64</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If ExtendedCommandResponse is not generated, it is most likely missing from the XML file. I see that the example XML in the documentation is missing this.&lt;/p&gt;
&lt;p&gt;Here is an example of how to implement it:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;&amp;lt;command source=&amp;quot;server&amp;quot; code=&amp;quot;0x01&amp;quot; name=&amp;quot;ExtendedCommandResponse&amp;quot; optional=&amp;quot;false&amp;quot; disableDefaultResponse=&amp;quot;true&amp;quot;&amp;gt;
   &amp;lt;description&amp;gt;Response to ExtendedCommand.&amp;lt;/description&amp;gt;
   &amp;lt;arg name=&amp;quot;arg1&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
&amp;lt;/command&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And this is what the complete MyCluster.xml will look like with this included:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;
&amp;lt;configurator&amp;gt;
   &amp;lt;cluster&amp;gt;
      &amp;lt;domain&amp;gt;General&amp;lt;/domain&amp;gt;
      &amp;lt;name&amp;gt;MyNewCluster&amp;lt;/name&amp;gt;
      &amp;lt;code&amp;gt;0xFFF1FC01&amp;lt;/code&amp;gt;
      &amp;lt;define&amp;gt;MY_NEW_CLUSTER&amp;lt;/define&amp;gt;
      &amp;lt;description&amp;gt;The MyNewCluster cluster showcases a cluster manufacturer extensions&amp;lt;/description&amp;gt;
      &amp;lt;attribute side=&amp;quot;server&amp;quot; code=&amp;quot;0xFFF10000&amp;quot; define=&amp;quot;MY_ATTRIBUTE&amp;quot; type=&amp;quot;boolean&amp;quot; writable=&amp;quot;true&amp;quot; default=&amp;quot;false&amp;quot; optional=&amp;quot;false&amp;quot;&amp;gt;MyAttribute&amp;lt;/attribute&amp;gt;
      &amp;lt;command source=&amp;quot;client&amp;quot; code=&amp;quot;0xFFF10000&amp;quot; name=&amp;quot;MyCommand&amp;quot; optional=&amp;quot;false&amp;quot;&amp;gt;
         &amp;lt;description&amp;gt;Command that takes two uint8 arguments and returns their sum.&amp;lt;/description&amp;gt;
         &amp;lt;arg name=&amp;quot;arg1&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
         &amp;lt;arg name=&amp;quot;arg2&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
      &amp;lt;/command&amp;gt;
      &amp;lt;event side=&amp;quot;server&amp;quot; code=&amp;quot;0xFFF10000&amp;quot; name=&amp;quot;MyEvent&amp;quot; priority=&amp;quot;info&amp;quot; optional=&amp;quot;false&amp;quot;&amp;gt;
         &amp;lt;description&amp;gt;Event that is generated by the server.&amp;lt;/description&amp;gt;
         &amp;lt;arg name=&amp;quot;arg1&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
      &amp;lt;/event&amp;gt;
   &amp;lt;/cluster&amp;gt;
   &amp;lt;clusterExtension code=&amp;quot;0x0028&amp;quot;&amp;gt;
      &amp;lt;attribute side=&amp;quot;server&amp;quot; code=&amp;quot;0x17&amp;quot; define=&amp;quot;EXTENDED_ATTRIBUTE&amp;quot; type=&amp;quot;boolean&amp;quot; writable=&amp;quot;true&amp;quot; default=&amp;quot;false&amp;quot; optional=&amp;quot;false&amp;quot;&amp;gt;ExtendedAttribute&amp;lt;/attribute&amp;gt;
      &amp;lt;command source=&amp;quot;client&amp;quot; code=&amp;quot;0x00&amp;quot; name=&amp;quot;ExtendedCommand&amp;quot; response=&amp;quot;ExtendedCommandResponse&amp;quot; optional=&amp;quot;false&amp;quot;&amp;gt;
         &amp;lt;description&amp;gt;Command that takes two uint8 arguments and returns their sum.&amp;lt;/description&amp;gt;
         &amp;lt;arg name=&amp;quot;arg1&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
         &amp;lt;arg name=&amp;quot;arg2&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
      &amp;lt;/command&amp;gt;
      &amp;lt;command source=&amp;quot;server&amp;quot; code=&amp;quot;0x01&amp;quot; name=&amp;quot;ExtendedCommandResponse&amp;quot; optional=&amp;quot;false&amp;quot; disableDefaultResponse=&amp;quot;true&amp;quot;&amp;gt;
         &amp;lt;description&amp;gt;Response to ExtendedCommand.&amp;lt;/description&amp;gt;
         &amp;lt;arg name=&amp;quot;arg1&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
      &amp;lt;/command&amp;gt;
      &amp;lt;event side=&amp;quot;server&amp;quot; code=&amp;quot;0x04&amp;quot; name=&amp;quot;ExtendedEvent&amp;quot; priority=&amp;quot;info&amp;quot; optional=&amp;quot;false&amp;quot;&amp;gt;
         &amp;lt;description&amp;gt;Event that is generated by the server.&amp;lt;/description&amp;gt;
         &amp;lt;arg name=&amp;quot;arg1&amp;quot; type=&amp;quot;int8u&amp;quot;/&amp;gt;
      &amp;lt;/event&amp;gt;
   &amp;lt;/clusterExtension&amp;gt;
   &amp;lt;enum name=&amp;quot;MyNewEnum&amp;quot; type=&amp;quot;int8u&amp;quot;&amp;gt;
      &amp;lt;cluster code=&amp;quot;0xFFF1FC01&amp;quot; /&amp;gt;
      &amp;lt;item name=&amp;quot;EnumValue1&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
      &amp;lt;item name=&amp;quot;EnumValue2&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;
   &amp;lt;/enum&amp;gt;
   &amp;lt;struct name=&amp;quot;MyStruct&amp;quot; isFabricScoped=&amp;quot;true&amp;quot;&amp;gt;
      &amp;lt;cluster code=&amp;quot;0xFFF1FC01&amp;quot;/&amp;gt;
      &amp;lt;item fieldId=&amp;quot;1&amp;quot; name=&amp;quot;Data&amp;quot; type=&amp;quot;octet_string&amp;quot; length=&amp;quot;128&amp;quot; isFabricSensitive=&amp;quot;true&amp;quot;/&amp;gt;
   &amp;lt;/struct&amp;gt;
   &amp;lt;deviceType&amp;gt;
      &amp;lt;name&amp;gt;my-new-device&amp;lt;/name&amp;gt;
      &amp;lt;domain&amp;gt;CHIP&amp;lt;/domain&amp;gt;
      &amp;lt;typeName&amp;gt;My new device&amp;lt;/typeName&amp;gt;
      &amp;lt;profileId editable=&amp;quot;false&amp;quot;&amp;gt;0x0104&amp;lt;/profileId&amp;gt;
      &amp;lt;deviceId editable=&amp;quot;false&amp;quot;&amp;gt;0xfff10001&amp;lt;/deviceId&amp;gt;
      &amp;lt;class&amp;gt;Simple&amp;lt;/class&amp;gt;
      &amp;lt;scope&amp;gt;Endpoint&amp;lt;/scope&amp;gt;
      &amp;lt;clusters lockOthers=&amp;quot;true&amp;quot;&amp;gt;
         &amp;lt;include cluster=&amp;quot;MyNewCluster&amp;quot; client=&amp;quot;true&amp;quot; server=&amp;quot;true&amp;quot; clientLocked=&amp;quot;false&amp;quot; serverLocked=&amp;quot;false&amp;quot;/&amp;gt;
      &amp;lt;/clusters&amp;gt;
   &amp;lt;/deviceType&amp;gt;
&amp;lt;/configurator&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will notify the developers that ExtendedCommandResponse is missing from the example file.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>