Hi all
we need to use report method to send a uint16 array to the remote one。
when i set the reported data type as ZCL_DATATYPE_ARRAY, but i saw there is not way to process this data tpye in zclGetDataTypeLength();
does it mean i need to change the zclGetDataTypeLength() to add process code in it ?
uint16 ADC_tmp[10];
for(uint8 i=0;i<10;i++)
{
ADC_tmp = GetADC();
delayms(1);
}
/*******************Create the Battery Low report command*************/
zclReportCmd_t *pBatLowReportCmd;
pBatLowReportCmd = (zclReportCmd_t *)osal_mem_alloc( sizeof( zclReportCmd_t )
+ ( 1 * sizeof( zclReport_t ) ) );
if ( pBatLowReportCmd != NULL )
{
//only report one attr
pBatLowReportCmd->numAttr = 1;
// Set up the first attribute
pBatLowReportCmd->attrList[0].attrID = ATTRID;
pBatLowReportCmd->attrList[0].dataType = ZCL_DATATYPE_ARRAY;
pBatLowReportCmd->attrList[0].attrData = &ADC_tmp[0];
//Send the report
zcl_SendReportCmd( Gasvalves_ENDPOINT, &CoordinatorAddr,
ZCL_CLUSTER_ID_GEN_BASIC, pBatLowReportCmd,
ZCL_FRAME_SERVER_CLIENT_DIR, 1, 0 );
}
//release data
osal_mem_free(pBatLowReportCmd);