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.

Rejoining Network

Hi,

Once sending the data from the end device to the parent I am clearing the NV Storage in the end device by 

NLME_InitNV();
NLME_SetDefaultNV();

 Once I clear the NV ,it is not able to scan for any parents , I think it needs to get connected back to the network.

Now I want that the end device should search for all available PANs, and connect to one as it does when it is first turned on. Can anyone tell me how do I do that?

I'd really appreciate any help.

Thanks.

  • You should not do what you are attempting - back out all of that code. Instead, you should send the ZED a leave request (either over the air from another device, like its parent, or from within the device from your Application code) and set the parameter in your request to initiate a new network join after leaving.

    /*********************************************************************
     * @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
     */
    afStatus_t ZDP_MgmtLeaveReq( zAddrType_t *dstAddr, uint8 *IEEEAddr, uint8 RemoveChildren,
                     uint8 Rejoin, uint8 SecurityEnable )

  • Dears,

    In my program, I use "zgWriteStartupOptions(ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE)" to clean up NV and do SystemReset() after that. You can have a try.