How to know Event Update Generated by Scene or Level Control

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to know Event Update Generated by Scene or Level Control

1,570件の閲覧回数
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);
ラベル(2)
0 件の賞賛
返信
3 返答(返信)

1,457件の閲覧回数
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 件の賞賛
返信

1,457件の閲覧回数
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 件の賞賛
返信

1,457件の閲覧回数
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 件の賞賛
返信