TI中文支持网
TI专业的中文技术问题搜集分享网站

zclMS_AppCallbacks_t 只有一个变量?而且没有实现回调?

// Register Callbacks table entry – enter function pointers for callbacks that
// the application would like to receive
typedef struct
{
  zclMS_PlaceHolder_t               pfnMSPlaceHolder; // Place Holder
//  NULL
} zclMS_AppCallbacks_t;

用到Temperature这个Cluster,发现MS的CallBack结构体只有一个参数,而且底层并没有实现回调,为什么呢?

one Man:

只有有Command的Cluster才会有?

Alvin Chen:

ZStatus_t zclMS_RegisterCmdCallbacks( uint8 endpoint, zclMS_AppCallbacks_t *callbacks )
{zclMSCBRec_t *pNewItem;zclMSCBRec_t *pLoop;
// Register as a ZCL Pluginif ( !zclMSPluginRegisted ){zcl_registerPlugin( ZCL_CLUSTER_ID_MS_ILLUMINANCE_MEASUREMENT,ZCL_CLUSTER_ID_MS_OCCUPANCY_SENSING,zclMS_HdlIncoming );zclMSPluginRegisted = TRUE;}
// Fill in the new profile listpNewItem = zcl_mem_alloc( sizeof( zclMSCBRec_t ) );if ( pNewItem == NULL )return (ZMemError);
pNewItem->next = (zclMSCBRec_t *)NULL;pNewItem->endpoint = endpoint;pNewItem->CBs = callbacks;
// Find spot in listif ( zclMSCBs == NULL ){zclMSCBs = pNewItem;}else{// Look for end of listpLoop = zclMSCBs;while ( pLoop->next != NULL )pLoop = pLoop->next;
// Put new item at end of listpLoop->next = pNewItem;}return ( ZSuccess );
}

one Man:

回复 Alvin Chen:

谢谢

one Man:

回复 one Man:

typedef struct
{zclMS_PlaceHolder_tpfnMSPlaceHolder; // Place Holder
//NULL
} zclMS_AppCallbacks_t;
只有一个变量是因为MS的Cluster都没有Command,不需要实现Command回调

Alvin Chen:

回复 one Man:

对的,你可以去看一下zclGeneral_AppCallbacks_t的回调。
typedef struct
{zclGCB_BasicReset_tpfnBasicReset;// Basic Cluster Reset commandzclGCB_IdentifyTriggerEffect_tpfnIdentifyTriggerEffect;// Identify Trigger Effect commandzclGCB_OnOff_tpfnOnOff;// On/Off cluster commandszclGCB_OnOff_OffWithEffect_tpfnOnOff_OffWithEffect;// On/Off cluster enhanced command Off with EffectzclGCB_OnOff_OnWithRecallGlobalScene_tpfnOnOff_OnWithRecallGlobalScene;// On/Off cluster enhanced command On with Recall Global ScenezclGCB_OnOff_OnWithTimedOff_tpfnOnOff_OnWithTimedOff;// On/Off cluster enhanced command On with Timed Off
#ifdef ZCL_LEVEL_CTRLzclGCB_LevelControlMoveToLevel_tpfnLevelControlMoveToLevel;// Level Control Move to Level commandzclGCB_LevelControlMove_tpfnLevelControlMove;// Level Control Move commandzclGCB_LevelControlStep_tpfnLevelControlStep;// Level Control Step commandzclGCB_LevelControlStop_tpfnLevelControlStop;// Level Control Stop command
#endif
#ifdef ZCL_GROUPSzclGCB_GroupRsp_tpfnGroupRsp;// Group Response commands
#endif
#ifdef ZCL_SCENESzclGCB_SceneStoreReq_tpfnSceneStoreReq;// Scene Store Request commandzclGCB_SceneRecallReq_tpfnSceneRecallReq;// Scene Recall Request commandzclGCB_SceneRsp_tpfnSceneRsp;// Scene Response command
#endif
#ifdef ZCL_ALARMSzclGCB_Alarm_tpfnAlarm;// Alarm (Response) commands
#endif
#ifdef SE_UK_EXTzclGCB_GetEventLog_tpfnGetEventLog;// Get Event Log commandzclGCB_PublishEventLog_tpfnPublishEventLog;// Publish Event Log command
#endifzclGCB_Location_tpfnLocation;// RSSI Location commandzclGCB_LocationRsp_tpfnLocationRsp;// RSSI Location Response command
} zclGeneral_AppCallbacks_t;

赞(0)
未经允许不得转载:TI中文支持网 » zclMS_AppCallbacks_t 只有一个变量?而且没有实现回调?
分享到: 更多 (0)