微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > ZDP_MgmtLeaveReq 问题

ZDP_MgmtLeaveReq 问题

时间:10-02 整理:3721RD 点击:

z-stack 2.5

问题:使用ZDP_MgmtLeaveReq该函数后路由节点无法退出网络

描述如下:

网络由协调器、路由1、路由2组成

路由1连接协调器、路由2连接路由1

使用该函数后,路由2无法断开路由1

路由节点未使用NV_RESTORE

退网代码如下:

zAddrType_t leaveid;

uint8 *extaddr;

extaddr=pNwkAddrRsp->extAddr;

leaveid.addrMode=(afAddrMode_t) Addr16Bit;

leaveid.addr.shortAddr=pNwkAddrRsp->nwkAddr;

ZDP_MgmtLeaveReq(&leaveid,extaddr,1,0,0);

AssocRemove(pNwkAddrRsp->extAddr);
ZDApp_NVUpdate();

抓包文件

Try to enable the following two defines:

#define ZDO_MGMT_LEAVE_REQUEST
#define ZDO_MGMT_LEAVE_RESPONSE

您好,这两个功能在,协调器与路由节点中都有定义了。为什么还会出现这种情况呢?

ZDP_MgmtLeaveReq(&leaveid,extaddr,1,0,0);第三个参数是1才会移除子设备

@fn ZDP_MgmtLeaveReq
*
* @brief This builds and send a Mgmt_Leave_req message.
*
* @param dstAddr - destination address of the message
* IEEEAddr - IEEE adddress of device that is removed
* RemoveChildren - set to 1 to remove the children of the
* device as well. 0 otherwise.
* Rejoin - set to 1 if the removed device should rejoin
afterwards. 0 otherwise.
*
* @return afStatus_t

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top