This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请问:CC2630 协调器让节点离开网络,应用层如何获取指示,并且有时间做应用处理

Other Parts Discussed in Thread: CC2630

TI:

使用芯片CC2630

请问协调器让一个终端离开这个网络,需要应用层收到指示,并且有时间应用处理,比如保存数据至NV。

目前做法:

(1)在应用层的DLSApp_setupZStackCallbacks中注册

          zdoCBReq.has_leaveIndCB = true;
          zdoCBReq.leaveIndCB = true;

(2)终端处理ZDO_ProcessMgmtLeaveReq函数中增加回调,ID采用:ZDO_LEAVE_IND_CBID(ZDAPP.h),

         其原在ZStackTaskInit中就有注册,在ZDO_LeaveInd中回调,(ZDO_LeaveInd在何处会被调用?)。

        void ZDO_ProcessMgmtLeaveReq( zdoIncomingMsg_t *inMsg )
       {……………………

            // Pass the leave indication to higher layer if callback registered.
            if (zdoCBFunc[ZDO_LEAVE_IND_CBID] != NULL)
            {
                 (void)zdoCBFunc[ZDO_LEAVE_IND_CBID](&ind);
            }

           ……………………

}

实际测试问题:应用层可以收到指示,但是处理时间不够。

请问如何修改?是否需要将NLME_LeaveReq延时处理?

谢谢。