How to know Event Update Generated by Scene or Level Control

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

How to know Event Update Generated by Scene or Level Control

1,565 Views
trungkstn
Contributor I

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);
Labels (2)
0 Kudos
Reply
3 Replies

1,452 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Trung,

It depends on the cluster that you are requesting.

For example, if you set on/off to the level control cluster.

    /* 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;
    psEndPointDefinition->pCallBackFunctions(&sZCL_CallBackEvent);

Previously, the routine found the cluster with the cluster instance.

Regards,

Mario

0 Kudos
Reply

1,452 Views
trungkstn
Contributor I

Hi Mario

Thank for replying. But I see your answer not meet my expectation. In my question, I want to know event E_ZCL_CBET_CLUSTER_UPDATE, for example with Level Control Cluster, generated by updating Scene (when run eCLD_ScenesUpdate) or by updating Level (when run eCLD_LevelControlUpdate).

Thanks.

0 Kudos
Reply

1,452 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Trung,

In both cases, but it will depend on the command that you send.

eCLD_LevelControlUpdate - will update the Level.

eCLD_ScenesHandleStoreSceneRequest - Handles store scene request.

Each scene corresponds to a set of stored values of specified attributes for one or more clusters on the same endpoint as the scenes cluster.

For a better reference look at the ZigBee Cluster Library Specification

Regards,

Mario

0 Kudos
Reply