<?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>Zigbee Multiple Endpoint declaration gives error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83265/zigbee-multiple-endpoint-declaration-gives-error</link><description>I want to expose 2 endpoints on the nrf52840 DK - one is the existing Onboard LED and the other is the GPIO pin (P0.02) which I have enabled in overlay. 
 I am extending the LightBulb example and repeating the steps of the declaration of the LED. However</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Jan 2022 14:25:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83265/zigbee-multiple-endpoint-declaration-gives-error" /><item><title>RE: Zigbee Multiple Endpoint declaration gives error</title><link>https://devzone.nordicsemi.com/thread/348960?ContentTypeID=1</link><pubDate>Fri, 21 Jan 2022 14:25:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60cfceb0-3e48-4789-9026-c569cf8e8991</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, sorry for the late reply. Here is the feedback from the Zigbee team here in Nordic:&lt;/p&gt;
&lt;div style="font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0;text-transform:none;white-space:normal;"&gt;
&lt;div&gt;ZBOSS ZCL APIs are not fully prepared to work with multiple endpoints (especially if you declare the same set of clusters on more than one endpoint).&lt;/div&gt;
&lt;div&gt;In order to do that, you have to define a new set of defines, that will handle the variable name collisions.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;We have done that in nRF5 SDK in the examples/multiprotocol/experimental/ble_zigbee_dynamic_color_light_bulb_thingy/zb_ha_dimmable_color_light.h. This header should be full of nice ideas on how to adapt the original ZCL declaration into your use case.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Multiple Endpoint declaration gives error</title><link>https://devzone.nordicsemi.com/thread/348878?ContentTypeID=1</link><pubDate>Fri, 21 Jan 2022 10:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a05f4fd-ff99-44b7-ae1a-532149ec21f1</guid><dc:creator>Manju_rn</dc:creator><description>&lt;p&gt;@Nordic Team, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please update on the above, whether the multiple endpoint definition code is correct or is there a better way to define the multiple endpoints&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Multiple Endpoint declaration gives error</title><link>https://devzone.nordicsemi.com/thread/346875?ContentTypeID=1</link><pubDate>Mon, 10 Jan 2022 10:06:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd9ca028-f0f9-41ee-85af-14d0b55d3b3d</guid><dc:creator>Manju_rn</dc:creator><description>&lt;p&gt;@Nordic Team, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please confirm that the above changes is the correct one and whether the macro is a problem?&amp;nbsp; If yes, can we expect bug to be fixed in the macro?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee Multiple Endpoint declaration gives error</title><link>https://devzone.nordicsemi.com/thread/345548?ContentTypeID=1</link><pubDate>Sun, 02 Jan 2022 10:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:493e0205-de4f-4078-af64-6424ff9840b3</guid><dc:creator>Manju_rn</dc:creator><description>&lt;p&gt;Okay I found the solution by implementing by expanding the macros, but it begs the question, why is the macro creating duplicate struct?&lt;/p&gt;
&lt;p&gt;The problem was the Macro ZB_HA_DECLARE_DIMMABLE_LIGHT_EP was creating a duplicate struct zb_af_simple_desc_6_0_s and its instance zb_af_simple_desc_6_0_t.&amp;nbsp; I just expanded this macro and change the struct naming. Maybe because it was used for creating the declaration for first Endpoint?&amp;nbsp; Anyway, if Nordic can fix this macro, it will save some debugging and effort in future&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// ZB_HA_DECLARE_DIMMABLE_LIGHT_EP(
// 	dimmable_light_ep_gpio,
// 	HA_DIMMABLE_LIGHT_ENDPOINT_GPIO,
// 	dimmable_light_clusters_gpio);

// Expansion of ZB_HA_DECLARE_DIMMABLE_LIGHT_EP - START
typedef ZB_PACKED_PRE struct zb_af_simple_desc_6_0_struc 
{ 
	zb_uint8_t endpoint; 
	zb_uint16_t app_profile_id; 
	zb_uint16_t app_device_id; 
	zb_bitfield_t app_device_version:4; 
	zb_bitfield_t reserved:4; 
	zb_uint8_t app_input_cluster_count; 
	zb_uint8_t app_output_cluster_count; 
	zb_uint16_t app_cluster_list[(6) + (0)]; 
} ZB_PACKED_STRUCT zb_af_simple_desc_6_0_t_instance;

ZB_AF_SIMPLE_DESC_TYPE(6, 0) simple_desc_dimmable_light_ep_gpio = 
	{ 
	  11, ZB_AF_HA_PROFILE_ID, ZB_HA_DIMMABLE_LIGHT_DEVICE_ID, ZB_HA_DEVICE_VER_DIMMABLE_LIGHT, 0, 6, 0, 
	  { 
	    ZB_ZCL_CLUSTER_ID_BASIC, ZB_ZCL_CLUSTER_ID_IDENTIFY, ZB_ZCL_CLUSTER_ID_SCENES, ZB_ZCL_CLUSTER_ID_GROUPS, ZB_ZCL_CLUSTER_ID_ON_OFF, ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL, 
	  }
	};
ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_infodevice_ctx_name, ZB_HA_DIMMABLE_LIGHT_REPORT_ATTR_COUNT);
ZBOSS_DEVICE_DECLARE_LEVEL_CONTROL_CTX(cvc_alarm_infodevice_ctx_name, ZB_HA_DIMMABLE_LIGHT_CVC_ATTR_COUNT);
ZB_AF_DECLARE_ENDPOINT_DESC(dimmable_light_ep_gpio, HA_DIMMABLE_LIGHT_ENDPOINT_GPIO, ZB_AF_HA_PROFILE_ID, 0, NULL, ZB_ZCL_ARRAY_SIZE(dimmable_light_clusters_gpio, zb_zcl_cluster_desc_t), dimmable_light_clusters_gpio, (zb_af_simple_desc_1_1_t*)&amp;amp;simple_desc_dimmable_light_ep_gpio, ZB_HA_DIMMABLE_LIGHT_REPORT_ATTR_COUNT, reporting_infodevice_ctx_name, ZB_HA_DIMMABLE_LIGHT_CVC_ATTR_COUNT, cvc_alarm_infodevice_ctx_name);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>