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);
}
//===========================================================================================
any update ..?