ZDO MGMT LEAVE REQ

=Description= This command allows a device to remove itself or remove another device based on the provided IEEE address. If a device removes itself, it will wait for approximately 5 seconds and then reset. Once the device resets it will not automatically attempt to rejoin the network.

You will receive in response a ZDO_MGMT_LEAVE_RSP confirming whether the device has been kicked off the network successfully. The other device will generate a ZDO_LEAVE_IND to its host.

=Library Function= Library function since version 1653.

zdoManagementLeaveRequest(uint8_t* ieeeAddress, uint16_t destinationAddress) in zdo.c

=Usage=

Fields:
 * DstAddr: The Short Address of the device that is generating the request.
 * DeviceAddr: The MAC Address that you wish to leave the network.
 * RemoveChildren/Rejoin: Whether the device should remove its child devices too. The current Stack Profile requires this to be 0, hence why it is not included in the library function.

Fields:
 * Status: 0 if success, else an error code.

=Example=

For example, Device A sends a ZDO_MGMT_LEAVE_REQ to device B.

Next, Device A's module will send a ZDO_MGMT_LEAVE_RSP (0x45B4) to host Then Device A will send a ZDO_LEAVE_IND with source address = Device B's short address

Device B's module will leave the network and send a ZDO_LEAVE_IND (0x45C9) to host, with source address = Device A's short address

Device B's module will then reset and send a reset indication to host

Device B is now off the network