router或者enddevice在加入网络时候会发NLME_NetworkDiscoveryRequest ()请求,请问网络中的router在收到NLME_NetworkDiscoveryRequest 请求数据后,在哪个地方给的应答,我想看看zstack怎么处理了!!
Viki Shi:
论坛有类似问题,解答请看这边: e2echina.ti.com/…/97492
Susan Yang:
您可以看一下它的回调函数 ZDO_NetworkDiscoveryConfirmCBZStatus_t ZDO_NetworkDiscoveryConfirmCB(uint8 status) {osal_event_hdr_t msg;// If Scan is initiated by ZDO_MGMT_NWK_DISC_REQ// Send ZDO_MGMT_NWK_DISC_RSP back #if defined ( ZDO_MGMT_NWKDISC_RESPONSE )if ( zdappMgmtNwkDiscReqInProgress ){zdappMgmtNwkDiscReqInProgress = false;ZDO_FinishProcessingMgmtNwkDiscReq();}else #endif{// Pass the confirm to another task if it registers the callback// Otherwise, pass the confirm to ZDApp.if (zdoCBFunc[ZDO_NWK_DISCOVERY_CNF_CBID] != NULL ){zdoCBFunc[ZDO_NWK_DISCOVERY_CNF_CBID]( (void*)&status );}else{// Otherwise, send scan confirm to ZDApp task to proceedmsg.status = ZDO_SUCCESS;ZDApp_SendMsg( ZDAppTaskID, ZDO_NWK_DISC_CNF, sizeof(osal_event_hdr_t), (uint8 *)&msg );}}return (ZSuccess); }// ZDO_NetworkDiscoveryConfirmCB由msg.hdr.status来指示网络发现是否成功,如果成功则把所发现的网络信息存在信息包msg中发往ZDAppTaskID,触发事件ZDO_NWK_DISC_CNF
您可以继续往下跟对ZDO_NWK_DISC_CNF的处理