Forums - QCA4020 : Zigbee : Issue in reporting multiple attributes of cluster.

2 posts / 0 new
Last post
QCA4020 : Zigbee : Issue in reporting multiple attributes of cluster.
vaibhav.t
Join Date: 3 Aug 20
Posts: 14
Posted: Wed, 2020-09-09 23:38
 
 
Hello.
 
I am using zigbee in QCA4020.
 
I want to send multiple attributes of some cluster to the zigbee server by reporting function.
 
single attribute is reported seccessfully.  while reporting multiple attributes i am not getting desired data at server side.
 
I am looking for some example code of reporting multiple attributes of cluster. 
 
Fail to find example code in QCA_Demo. 
 
Any leads would be helpful.
 
Sharing screenshot of sniffer. I am also printing structure data on debug port. All the data is releavent but on sniffer it is not showing its related attribute and at some places data is different from structure data. ( ATTRIBUTE STRUCTURE ).
 
Aslo please go through part of code which sends the multiple attributes to the zigbee server.
 
//===========================================================================================
 
boolean ZB_energy_monitor_reportAttribute(uint16_t cluster_index,uint32_t *data ,uint16_t endpoint_,uint16_t number_of_attrbutes_, qapi_ZB_CL_Attribute_t Attr_List[])
{
qapi_Status_t result,attcount=0;
qapi_ZB_CL_General_Send_Info_t send_info;
ZCL_Demo_Cluster_Info_t *cluster_info;
 
qapi_ZB_CL_Attr_Report_t *attribute_report = malloc( number_of_attrbutes_ * sizeof(qapi_ZB_CL_Attr_Report_t )  );
 
memset(&send_info, 0, sizeof(qapi_ZB_CL_General_Send_Info_t));
 
send_info.DstAddrMode = QAPI_ZB_ADDRESS_MODE_SHORT_ADDRESS_E;
send_info.DstAddress.ShortAddress = (uint16_t) SHORT_ADDRESS; //DeviceEntry->Address.ShortAddress;
send_info.DstEndpoint = (uint8_t) DESTINATION_END_POINT; //DeviceEntry->Endpoint;
send_info.SeqNum = GetNextSeqNum();
 
LOG_INFO("cluster_index  %d \n", cluster_index);
LOG_INFO("endpoint_ %d \n", endpoint_);
LOG_INFO("number_of_attrbutes_  %d \n------------------------------------------------------------\n\n", number_of_attrbutes_);
 
while(attcount < number_of_attrbutes_)
{
attribute_report[attcount].AttrId  =  Attr_List[attcount].AttributeId;
attribute_report[attcount].DataType  =  Attr_List[attcount].DataType;
attribute_report[attcount].AttrLength  =  Attr_List[attcount].DataLength;
attribute_report[attcount].AttrData  =  data[attcount];   // compulsory
 
LOG_INFO("AttrId  %d \n" , attribute_report[attcount].AttrId );
LOG_INFO("AttrLength  %d \n" , attribute_report[attcount].AttrLength );
LOG_INFO("DataType  %d \n" , attribute_report[attcount].DataType );
LOG_INFO("number_of_attrbutes_  %d \n" , number_of_attrbutes_);
LOG_INFO("attcount  %d \n" , attcount);
LOG_INFO("AttrData  %d %d  \n\n" , attribute_report[attcount].AttrData , data[attcount]   );
 
attcount++;
}
 
 
cluster_info = ZCL_FindClusterByIndex((uint16_t) cluster_index, ZCL_DEMO_IGNORE_CLUSTER_ID);
 
result = qapi_ZB_CL_Report_Attributes(cluster_info->Handle, &send_info, 5  , &attribute_report );
 
 
if (result != QAPI_OK)
{
LOG_ERROR("FAILED: qapi_ZB_CL_Report_Attributes %d \n", result);
}
else
{
LOG_INFO("qapi_ZB_CL_Report_Attributes SUCCESS... %d \n", result);
}
 
return (result);
 
}
//===========================================================================================
 
 
 
 
 
 
 
  • Up2
  • Down0
vaibhav.t
Join Date: 3 Aug 20
Posts: 14
Posted: Fri, 2020-09-11 04:02

 

 

 

any update ..? 

  • Up1
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.