AnsweredAssumed Answered

How to know Event Update Generated by Scene or Level Control

Question asked by trung trinh on Aug 20, 2019
Latest reply on Aug 30, 2019 by Mario Ignacio Castaneda Lopez

I'm using JN5169 and SW4170

I have some confusion when handle event E_ZCL_CBET_CLUSTER_UPDATE generated by Scene and Level Control.

Now in your SDK it is this event with both Scene and Level Control has the same parametter, so if i want to know what (Scene or Level Control) generate event E_ZCL_CBET_CLUSTER_UPDATE?

 

With Level Control, in function eCLD_LevelControlUpdate

 

...
if (bGenerateEvent == TRUE) {
/* Set up a callback to let the user know that an update event occurred */
sZCL_CallBackEvent.u8EndPoint = psEndPointDefinition->u8EndPointNumber;
sZCL_CallBackEvent.psClusterInstance = psClusterInstance;
sZCL_CallBackEvent.pZPSevent = NULL;
sZCL_CallBackEvent.eEventType = E_ZCL_CBET_CLUSTER_UPDATE;

/* Call callback to let user know an update occurred */
psEndPointDefinition->pCallBackFunctions(&sZCL_CallBackEvent);

#if (defined CLD_SCENES) && (defined SCENES_SERVER)
vCLD_ScenesUpdateSceneValid( psEndPointDefinition);
#endif
}

 

With Scene update, in function eCLD_LevelControlSceneEventHandler

 

...

case E_ZCL_SCENE_EVENT_RECALL:
...
    /* Inform the application that the cluster has just been updated */
    sZCL_CallBackEvent.u8EndPoint = psEndPointDefinition->u8EndPointNumber;
    sZCL_CallBackEvent.psClusterInstance = psClusterInstance;
    sZCL_CallBackEvent.pZPSevent = NULL;
    sZCL_CallBackEvent.eEventType = E_ZCL_CBET_CLUSTER_UPDATE;

    // call user
    psEndPointDefinition->pCallBackFunctions(&sZCL_CallBackEvent);

Outcomes