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.

NLME_LeaveReq( );函数让终端退网


我在协调器中使用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.