Part Number:CC2530
你好,请问一下我是基于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 Profilebdb_RegisterSimpleDescriptor(&zclGenericApp_SimpleDesc);// Register the ZCL General Cluster Library callback functionszclGeneral_RegisterCmdCallbacks(GENERICAPP_ENDPOINT, &zclGenericApp_CmdCallbacks);// GENERICAPP_TODO: Register other cluster command callbacks here// Register the application's attribute listzcl_registerAttrList(GENERICAPP_ENDPOINT, zclGenericApp_NumAttributes, zclGenericApp_Attrs);// Register the Application to receive the unprocessed Foundation command/response messageszcl_registerForMsg(zclGenericApp_TaskID); #ifdef ZCL_DISCOVER// Register the application's command listzcl_registerCmdList(GENERICAPP_ENDPOINT, zclCmdsArraySize, zclGenericApp_Cmds); #endif// Register low voltage NV memory protection application callbackRegisterVoltageWarningCB(zclSampleApp_BatteryWarningCB);afRegister(&cood_ep_desc);// Register for all key events - This app will handle all key eventsRegisterForKeys(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} #endifbdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION |BDB_COMMISSIONING_MODE_NWK_STEERING |BDB_COMMISSIONING_MODE_FINDING_BINDING |BDB_COMMISSIONING_MODE_INITIATOR_TL); #ifdef LCD_SUPPORTEDHalLcdWriteString((char *)sDeviceName, HAL_LCD_LINE_3); #endif // LCD_SUPPORTED }
是否遗漏了某个部分,导致
没有进入这个switch分支?和
zclGenericApp_ProcessIncomingMsg((zclIncomingMsg_t *)MSGpkt);函数?
Kevin Qiu1:
附上抓包文件和zcl_SendRead部分的代码,调用 zcl_SendRead返回的状态是什么?
,
Xin Yang:
返回的是Unsupport Attr数据包
,
Xin Yang:
zclReadCmd_t cmd;cmd.numAttr = 1;cmd.attrID[0] = ATTRID_BASIC_MANUFACTURER_NAME;zcl_SendRead(GENERICAPP_ENDPOINT,&coor_addr,ZCL_CLUSTER_ID_GEN_BASIC,&cmd,ZCL_FRAME_SERVER_CLIENT_DIR,TRUE,bdb_getZCLFrameCounter());这是发送部分的代码
https://1drv.ms/u/s!Apn2N9UUQn-dk8p_rw-7t-dQ4olbWA?e=uwQ7A0 这是wireshark 的抓包档
-DDEFAULT_KEY="{0x9c,0x2d,0x0a,0x8a,0x36,0x51,0x7b,0xf3,0x0c,0xb5,0xee,0xd6,0x71,0xa0,0x58,0x3f}"
,
YiKai Chen:
抓包檔裡看到有回應,先檢查有沒有進到zcl_ProcessMessageMSG