微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > NLME_LeaveReq( );函数让终端退网

NLME_LeaveReq( );函数让终端退网

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


我在协调器中使用NLME_LeaveReq(  );函数让终端退网,为什么不仅要求的终端被退网,其他的终端也被退网了

程序如下:
NLME_LeaveReq_t leaveReq;

 osal_memset((uint8 *)&leaveReq,0,sizeof(NLME_LeaveReq_t));

 osal_memcpy(leaveReq.extAddr,extAddr,Z_EXTADDR_LEN);

 leaveReq.removeChildren = 0;

 leaveReq.rejoin = 1;

 leaveReq.silent = 0;

 NLME_LeaveReq( &leaveReq );
 这里查看终端IEEE和终端读出的一样,没有问题
HalUARTWrite(0,extAddr,8 );

 

我将程序改成这样,又不能删除终端。 osal_memset和osal_memcpy函数的意义是什么?

leaveReq.extAddr=extAddr;
 
  HalUARTWrite(0,leaveReq.extAddr,8 );
 
 leaveReq.removeChildren = 0;

 leaveReq.rejoin = 1;

 leaveReq.silent = 0;

 NLME_LeaveReq( &leaveReq );
 
HalUARTWrite(0,extAddr,8 );

How to make a device leaving the network

Use the NLME_LeaveReq() function.

For making a remote node to leave the network, the extAddr pointer of the NLME_LeaveReq_t parameter shall be assigned to the remote node 64 bit IEEE address. The address of a remote node can be retrieved during association process by processing the Device_annce message as shown in "#How to get the address of new devices joining the network".

For making the local node to leave the network, the extAddr pointer of the NLME_LeaveReq_t parameter shall be assigned as NULL.

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

网站地图

Top