<?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 Re: Custom Attributes Addition In Temperature Measurement Cluster in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1339472#M3345</link>
    <description>&lt;P&gt;Thanks for your response&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/86938"&gt;@mario_castaneda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added another attribute to send the values of the 2nd temperature sensor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regard,&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;</description>
    <pubDate>Tue, 14 Sep 2021 05:04:39 GMT</pubDate>
    <dc:creator>talhamir49</dc:creator>
    <dc:date>2021-09-14T05:04:39Z</dc:date>
    <item>
      <title>Custom Attributes Addition In Temperature Measurement Cluster</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1338839#M3340</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I'm using the JN-5189 DK and I want to report the value of 4 temperature sensors to the coordinator but unfortunately, the msTemperatureMeasurement cluster has only one attribute for reporting temperature.&amp;nbsp; How can I add more attributes to the cluster?&lt;/P&gt;&lt;P&gt;Thank&amp;nbsp; you&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 06:00:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1338839#M3340</guid>
      <dc:creator>talhamir49</dc:creator>
      <dc:date>2021-09-13T06:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Attributes Addition In Temperature Measurement Cluster</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1339240#M3344</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190822"&gt;@talhamir49&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Sensor device responding to simple descriptor request on all endpoints does not guarantee that endpoint has been registered at ZigBee Cluster Library. You should send some read attribute request commands to see whether they get back the read attribute response from the newly added endpoint or not.&lt;/P&gt;
&lt;P&gt;Now regarding the default reporting for attributes on the additional endpoints that you added, you need to consider the following points:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;While creating the report they need to pass the endpoint corresponding to the attribute on that endpoint.&lt;/LI&gt;
&lt;LI&gt;You need to use bound non - blocking addressing mode.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Please look at the next example, LightSensor application where I have added another endpoint (Endpoint ID 2) on which Temperature Sensor sits and Measured Value attribute for temperature measurement cluster is reported along with Measured Value attribute for IL luminance Measurement cluster from Endpoint 1. You could take this example as a reference.&lt;/P&gt;
&lt;P&gt;Now to create the report the following changes are required:&lt;/P&gt;
&lt;P&gt;1.In zcl_options.h file, define the number of reports as in the example, two attributes which are reported the value for ZCL_NUMBER_OF_REPORTS should be set 2 as shown below:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #7f0055; background: yellow; font-size: 8pt;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: yellow; color: black; font-size: 8pt;"&gt; ZCL_NUMBER_OF_REPORTS 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;2. In app_reporting.h, add endpoint as of the parameter for&amp;nbsp;tsReports structure as shown below:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;typedef struct 
{
   uint8 u8EndpointID;
   uint16 u16ClusterID;
   tsZCL_AttributeReportingConfigurationRecord sAttributeReportingConfigurationRecord;
}tsReports;&lt;/LI-CODE&gt;
&lt;P&gt;3. In App_LightSensor.c, change the definition of default report record to&amp;nbsp;add the endpoint Id as one of the parameters and to&amp;nbsp;add a new entry for temperature measurement as shown below:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;/* define the default reports */
tsReports asDefaultReports[ZCL_NUMBER_OF_REPORTS] = \
{\
{LIGHTSENSOR_SENSOR_ENDPOINT,MEASUREMENT_AND_SENSING_CLUSTER_ID_ILLUMINANCE_MEASUREMENT,{0, E_ZCL_UINT16,E_CLD_ILLMEAS_ATTR_ID_MEASURED_VALUE,ZLO_MIN_REPORT_INTERVAL,ZLO_MAX_REPORT_INTERVAL,0,{LIGHT_SENSOR_MINIMUM_REPORTABLE_CHANGE}}},\

{LIGHTSENSOR_TEMPSENSOR_ENDPOINT,MEASUREMENT_AND_SENSING_CLUSTER_ID_TEMPERATURE_MEASUREMENT,{0, E_ZCL_INT16,E_CLD_TEMPMEAS_ATTR_ID_MEASURED_VALUE,ZLO_MIN_REPORT_INTERVAL,ZLO_MAX_REPORT_INTERVAL,0,{TEMPERATURE_SENSOR_MINIMUM_REPORTABLE_CHANGE}}},\

};&lt;/LI-CODE&gt;
&lt;P&gt;4.In app_reporting.c, change the functions vMakeSupportedAttributesReportable&amp;nbsp;and vSaveReportableRecord as follow:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;PUBLIC void vMakeSupportedAttributesReportable(void)
{
uint16 u16AttributeEnum;
uint16 u16ClusterId;
int i;

tsZCL_AttributeReportingConfigurationRecord* psAttributeReportingConfigurationRecord;
for(i=0; i&amp;lt;ZCL_NUMBER_OF_REPORTS; i++)
{
u16AttributeEnum = asSavedReports[i].sAttributeReportingConfigurationRecord.u16AttributeEnum;
u16ClusterId = asSavedReports[i].u16ClusterID;
psAttributeReportingConfigurationRecord = &amp;amp;(asSavedReports[i].sAttributeReportingConfigurationRecord);
DBG_vPrintf(TRACE_REPORT, "MAKE Reportable ep %d\n", asSavedReports[i].u8EndpointID);

DBG_vPrintf(TRACE_REPORT, "Cluster %04x Attribute %04x Min %d Max %d IntV %d Direct %d Change %d\n",
u16ClusterId,
u16AttributeEnum,
asSavedReports[i].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval,
asSavedReports[i].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval,
asSavedReports[i].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField,
asSavedReports[i].sAttributeReportingConfigurationRecord.u8DirectionIsReceived,

asSavedReports[i].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zint8ReportableChange);

eZCL_CreateLocalReport( asSavedReports[i].u8EndpointID, u16ClusterId, 0, TRUE, psAttributeReportingConfigurationRecord);
}
}
 
PUBLIC void vSaveReportableRecord( uint8 u8Endpoint,
uint16 u16ClusterID,tsZCL_AttributeReportingConfigurationRecord* psAttributeReportingConfigurationRecord)
{
int iIndex = 0;
/*For MeasuredValue attribute in Illuminance Measurement Cluster*/
asSavedReports[iIndex].u16ClusterID=u16ClusterID;
asSavedReports[iIndex].u8EndpointID=u8Endpoint;
memcpy( &amp;amp;(asSavedReports[iIndex].sAttributeReportingConfigurationRecord),
psAttributeReportingConfigurationRecord,
sizeof(tsZCL_AttributeReportingConfigurationRecord) );

DBG_vPrintf(TRACE_REPORT,"Cluster %04x Type %d Attrib %04x Min %d Max %d IntV %d Direction %d Change %d\n",
asSavedReports[iIndex].u16ClusterID,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.eAttributeDataType,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.u16AttributeEnum,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.u8DirectionIsReceived,
asSavedReports[iIndex].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange );

/*Save this Records*/
PDM_eSaveRecordData(PDM_ID_APP_REPORTS,
asSavedReports,sizeof(asSavedReports));
}&lt;/LI-CODE&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN style="color: black; font-size: 8.5pt;"&gt;In&amp;nbsp;app_zcl_sensor_task.c, inside APP_ZCL_cbEndpointCallback add the following changes:&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="c"&gt;case E_ZCL_CBET_REPORT_INDIVIDUAL_ATTRIBUTES_CONFIGURE:
{
tsZCL_AttributeReportingConfigurationRecord *psAttributeReportingRecord= &amp;amp;psEvent-&amp;gt;uMessage.sAttributeReportingConfigurationRecord;
 if (E_ZCL_SUCCESS == psEvent-&amp;gt;eZCL_Status)

{
if(MEASUREMENT_AND_SENSING_CLUSTER_ID_ILLUMINANCE_MEASUREMENT == psEvent-&amp;gt;psClusterInstance-&amp;gt;psClusterDefinition-&amp;gt;u16ClusterEnum)
{

vSaveReportableRecord(psEvent-&amp;gt;u8EndPoint,MEASUREMENT_AND_SENSING_CLUSTER_ID_ILLUMINANCE_MEASUREMENT,psAttributeReportingRecord);
}
if(MEASUREMENT_AND_SENSING_CLUSTER_ID_TEMPERATURE_MEASUREMENT == psEvent-&amp;gt;psClusterInstance-&amp;gt;psClusterDefinition-&amp;gt;u16ClusterEnum)
{
vSaveReportableRecord(psEvent-&amp;gt;u8EndPoint,MEASUREMENT_AND_SENSING_CLUSTER_ID_TEMPERATURE_MEASUREMENT,psAttributeReportingRecord);
}
}
}
break;&lt;/LI-CODE&gt;
&lt;P&gt;Be sure that the next file vReportSchedulerUpdate function inside zcl_reportScheduler.c (JN-SW-4170/Components/ZCIF/Source) should be as below:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt; if(psTransmitReportRecord!=NULL)                   
{                        
// transmit request                        
sZCL_Address.eAddressMode = E_ZCL_AM_BOUND_NON_BLOCKING; //be sure that your file is like this [MC]                      
  if(eZCL_TransmitDataRequest(myPDUM_thAPduInstance,                                                    
   u16outputOffset,    
   psEndPointDefinition-&amp;gt;u8EndPointNumber,   
   0, // No dest EP for bound                                                    
   psClusterInstance-&amp;gt;psClusterDefinition-&amp;gt;u16ClusterEnum,                                                  
   &amp;amp;sZCL_Address) != E_ZCL_SUCCESS)*/                    
     {                             return;                        
     }                    
} 

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if you need any further assistance.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Mario&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 17:31:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1339240#M3344</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2021-09-13T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Attributes Addition In Temperature Measurement Cluster</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1339472#M3345</link>
      <description>&lt;P&gt;Thanks for your response&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/86938"&gt;@mario_castaneda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added another attribute to send the values of the 2nd temperature sensor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regard,&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 05:04:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Custom-Attributes-Addition-In-Temperature-Measurement-Cluster/m-p/1339472#M3345</guid>
      <dc:creator>talhamir49</dc:creator>
      <dc:date>2021-09-14T05:04:39Z</dc:date>
    </item>
  </channel>
</rss>

