ZPS_eAplZdoLeaveNetwork

ZPS_teStatus ZPS_eAplZdoLeaveNetwork(
                            uint64 u64Addr,
                            bool bRemoveChildren,
                            bool bRejoin);

Description

This function can be used to request a node to leave the network. The leaving node can be a child of the requesting node or can be the requesting node itself (excluding the Coordinator).

The node being asked to leave the network is specified by means of its IEEE (MAC) address (or zero, if a node is requesting itself to leave the network). You must also:

  • Use the parameter bRemoveChildren to specify whether children of the leaving node must leave their parent - if this is the case, the leaving node will automatically call ZPS_eAplZdoLeaveNetwork() for each of its children. This parameter must always be set to FALSE when the function is called on an End Device (as there are no children).

  • Use the parameter bRejointo specify whether the leaving node must attempt to rejoin the network (probably via another parent) immediately after leaving.

Note: If you wish to move a whole network branch from under the requesting node to a different parent node, set bRemoveChildren to FALSE and bRejoin to TRUE.

If this function successfully initiates the removal of a node, ZPS_E_SUCCESS will be returned. Subsequently, when the removal is complete, the stack event ZPS_EVENT_NWK_LEAVE_CONFIRM is generated. For details of this event, refer to Section 7.2.2.12.

Parent topic:ZPS_eAplZdoLeaveNetwork

Parameters

u64Addr 64-bit IEEE (MAC) address of node to leave network (zero value will cause requesting node to leave network)

bRemoveChildren Boolean value indicating whether children of leaving node must leave their parent:

TRUE: Children to leave FALSE: Children not to leave

bRejoin Boolean value indicating whether leaving node must attempt to rejoin network immediately after leaving:

TRUE: Rejoin network immediately FALSE: Do not rejoin network

Parent topic:ZPS_eAplZdoLeaveNetwork

Returns

  • ZPS_E_SUCCESS (removal of node successfully started)

  • APS return codes, listed and described in Section 11.2.2

  • NWK return codes, listed and described in Section 11.2.3

  • MAC return codes, listed and described in Section 11.2.4

Parent topic:ZPS_eAplZdoLeaveNetwork

Parent topic:Network deployment functions