<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Sharing Cluster Instances Across Endpoints in Wireless MCU</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/Sharing-Cluster-Instances-Across-Endpoints/m-p/735743#M4057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the best way to share various cluster instances across multiple endpoints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im working on a device with three endpoints, to save work and make better use of ram I want to share the instances of Basic, Identify, Power Configuration and Commissioning across the three endpoints.&lt;/P&gt;&lt;P&gt;JN-UG-3115 r1.2 (D.1) Describes two solutions to implement the Basic cluster across multiple endpoints:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt;A&lt;/EM&gt;) A single cluster instance on a dedicated ‘physical device’ endpoint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt;B&lt;/EM&gt;) A separate cluster instance on each ‘logical device’ endpoint, but each&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cluster instance must use the same tsZCL_ClusterInstance structure&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(and the same attribute values)&lt;BR /&gt; &lt;BR /&gt;(&lt;EM&gt;A&lt;/EM&gt;) sounds like what Im trying to achieve, but dont want an additional endpoint containing Basic, Identify, Power Configuration and Commissioning - unless there's an existing and corresponding application device id I can use.&lt;BR /&gt;&lt;BR /&gt;(&lt;EM&gt;B&lt;/EM&gt;) sounds like what I have at present, each endpoint having its own instance of Basic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any information would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Mar 2018 11:29:52 GMT</pubDate>
    <dc:creator>davidlythge</dc:creator>
    <dc:date>2018-03-07T11:29:52Z</dc:date>
    <item>
      <title>Sharing Cluster Instances Across Endpoints</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Sharing-Cluster-Instances-Across-Endpoints/m-p/735743#M4057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the best way to share various cluster instances across multiple endpoints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im working on a device with three endpoints, to save work and make better use of ram I want to share the instances of Basic, Identify, Power Configuration and Commissioning across the three endpoints.&lt;/P&gt;&lt;P&gt;JN-UG-3115 r1.2 (D.1) Describes two solutions to implement the Basic cluster across multiple endpoints:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt;A&lt;/EM&gt;) A single cluster instance on a dedicated ‘physical device’ endpoint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt;B&lt;/EM&gt;) A separate cluster instance on each ‘logical device’ endpoint, but each&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cluster instance must use the same tsZCL_ClusterInstance structure&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(and the same attribute values)&lt;BR /&gt; &lt;BR /&gt;(&lt;EM&gt;A&lt;/EM&gt;) sounds like what Im trying to achieve, but dont want an additional endpoint containing Basic, Identify, Power Configuration and Commissioning - unless there's an existing and corresponding application device id I can use.&lt;BR /&gt;&lt;BR /&gt;(&lt;EM&gt;B&lt;/EM&gt;) sounds like what I have at present, each endpoint having its own instance of Basic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any information would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2018 11:29:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Sharing-Cluster-Instances-Across-Endpoints/m-p/735743#M4057</guid>
      <dc:creator>davidlythge</dc:creator>
      <dc:date>2018-03-07T11:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sharing Cluster Instances Across Endpoints</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Sharing-Cluster-Instances-Across-Endpoints/m-p/735744#M4058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;In zcl_options.h:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;/* Create a shared device - a container for clusters shared between multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; * endpoints, including basic, identify, power configuration, commissioning etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define SHARED_CLUSTERS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define BASIC_SHARED&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define POWER_CONFIGURATION_SHARED&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define COMMISSIONING_SHARED&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your application, dont forget if you need to reset the cluster using 'memset' like&lt;BR /&gt;in various NXP examples, dont forget to set/preserve the devices pointer to the shared cluster instance...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;memset(&amp;amp;sDevices.sTemperatureDevice,0,sizeof(tsHA_TemperatureSensorDevice));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; #if (defined SHARED_CLUSTERS) &amp;amp;&amp;amp; (defined POWER_CONFIGURATION_SHARED )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; sDevices.sTemperatureDevice.psPowerConfigServerCluster = &amp;amp;sShared.sPowerConfigServerCluster;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; #endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the small gotcha above, it works really well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using shared clusters are an option, reduce overall flash size and memory size, and saves work because&lt;BR /&gt;now you don't need to populate identical clusters on other endpoints. Everything else works as normal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to use shared clusters just remove the define statements from zcl_options mentioned&lt;BR /&gt;above and it will work as originally intended by NXP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've included a .zip containing a directory structure for JN-SW-4170/Components. It includes the&lt;BR /&gt;small Shared.h file and modified NXP temperature_sensor.h/.c files as examples.&lt;/P&gt;&lt;P&gt;Components\ZCL\Clusters\General\Include\Shared.h&lt;BR /&gt; Components\ZCL\Devices\ZHA\HVAC\Include\temperature_sensor.h&lt;BR /&gt; Components\ZCL\Devices\ZHA\HVAC\Source\temperature_sensor.c&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2018 18:34:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Sharing-Cluster-Instances-Across-Endpoints/m-p/735744#M4058</guid>
      <dc:creator>davidlythge</dc:creator>
      <dc:date>2018-03-08T18:34:04Z</dc:date>
    </item>
  </channel>
</rss>

