How do I use the eZCL_ReportAttribute() function?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How do I use the eZCL_ReportAttribute() function?

708 次查看
qidongli
Contributor II

When the eZCL_ReportAttribute() function is called, how to change the data type and data value reported by the node.

0 项奖励
回复
1 回复

535 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Qidong Li,

You can see an example JN-AN-1189, Light Sensor the vMakeSupportedAttributesReportable. app_reporting.c

The function is calling the  eZCL_CreateLocalReport, you could call in that section.

How to change the value?

Please look at the app_light.c file an inside the vAPP_LightSensorSample, you will see how the struct is modifying the value.

u16ALSResult = u16TSL2550_ReadResult();
DBG_vPrintf(TRACE_LIGHT_SENSOR,"\nResult = %d",u16ALSResult);

    if(u16ALSResult > (LIGHT_SENSOR_MINIMUM_MEASURED_VALUE - 1))
        sSensor.sIlluminanceMeasurementServerCluster.u16MeasuredValue = u16ALSResult;
    else
        sSensor.sIlluminanceMeasurementServerCluster.u16MeasuredValue = 
                       LIGHT_SENSOR_MINIMUM_MEASURED_VALUE;

Regards,

Mario

0 项奖励
回复