你好,请问一下我是基于GenericApp写的代码,由ZED向ZC发起ZCL_ReadSend请求的时候,发现并没有触发
case ZCL_INCOMING_MSG:部分的代码,实际追踪发现,ZCL_ReadSend请求被static uint8 zclProcessInReadCmd( zclIncoming_t *pInMsg )函数处理了
源代码基本没有动过,以下是Init部分
void zclGenericApp_Init(byte task_id)
{
zclGenericApp_TaskID = task_id;
// This app is part of the Home Automation Profile
bdb_RegisterSimpleDescriptor(&zclGenericApp_SimpleDesc);
// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks(GENERICAPP_ENDPOINT, &zclGenericApp_CmdCallbacks);
// GENERICAPP_TODO: Register other cluster command callbacks here
// Register the application's attribute list
zcl_registerAttrList(GENERICAPP_ENDPOINT, zclGenericApp_NumAttributes, zclGenericApp_Attrs);
// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg(zclGenericApp_TaskID);
#ifdef ZCL_DISCOVER
// Register the application's command list
zcl_registerCmdList(GENERICAPP_ENDPOINT, zclCmdsArraySize, zclGenericApp_Cmds);
#endif
// Register low voltage NV memory protection application callback
RegisterVoltageWarningCB(zclSampleApp_BatteryWarningCB);
afRegister(&cood_ep_desc);
// Register for all key events - This app will handle all key events
RegisterForKeys(zclGenericApp_TaskID);
bdb_RegisterCommissioningStatusCB(zclGenericApp_ProcessCommissioningStatus);
bdb_RegisterIdentifyTimeChangeCB(zclGenericApp_ProcessIdentifyTimeChange);
bdb_RegisterBindNotificationCB(zclGenericApp_BindNotification);
#if (defined(BDB_TL_TARGET) && (BDB_TOUCHLINK_CAPABILITY_ENABLED == TRUE))
bdb_RegisterTouchlinkTargetEnableCB(zclGenericApp_ProcessTouchlinkTargetEnable);
#endif
#ifdef ZCL_DIAGNOSTIC
// Register the application's callback function to read/write attribute data.
// This is only required when the attribute data format is unknown to ZCL.
zcl_registerReadWriteCB(GENERICAPP_ENDPOINT, zclDiagnostic_ReadWriteAttrCB, NULL);
if (zclDiagnostic_InitStats() == ZSuccess)
{
// Here the user could start the timer to save Diagnostics to NV
}
#endif
bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION |
BDB_COMMISSIONING_MODE_NWK_STEERING |
BDB_COMMISSIONING_MODE_FINDING_BINDING |
BDB_COMMISSIONING_MODE_INITIATOR_TL);
#ifdef LCD_SUPPORTED
HalLcdWriteString((char *)sDeviceName, HAL_LCD_LINE_3);
#endif // LCD_SUPPORTED
}是否遗漏了某个部分,导致
没有进入这个switch分支?和
zclGenericApp_ProcessIncomingMsg((zclIncomingMsg_t *)MSGpkt);函数?
