How do I use the eZCL_ReportAttribute() function?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I use the eZCL_ReportAttribute() function?

619 Views
qidongli
Contributor II

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

0 Kudos
1 Reply

446 Views
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 Kudos