Joining

Joining is the process when a a Zigbee Router or Zigbee End Device selects which network to join and joins that network. It also typically refers to the startup behavior of a Zigbee Coordinator; although the Coordinator doesn't join a network, it creates one.

When a Router or End Device Join the network they do the following:
 * 1) Scan through each Channel on the channel list. This takes approximately 480mSec and will produce a list of possible networks.
 * 2) Select a parent to join. If using a pre-assigned PANID then it will only join a network that matches that PAN ID of course. Otherwise it will join the one with the best signal, as long as that parent has room for more children.
 * 3) Attempt to join the network by sending a join request
 * 4) Now, the parent decides whether to allow the node to join. If joining is turned off then the coordinator will not allow the node to join. If it allows the node to join then it will assign the node a Short Address.
 * 5) Finally the node will send a ZDO END DEVICE ANNCE IND message to the Coordinator which contains the Short Address and the MAC Address. Any other nodes that receive the message will update their routing table accordingly.

This process is typically automatic but can be changed using:
 * ZDO_MGMT_PERMIT_JOIN_REQ Configures whether devices allow joining
 * ZDO_MGMT_LEAVE_REQ Removes devices from the network
 * ZDO_NWK_DISCOVERY_REQ Find all Zigbee networks in range
 * ZDO_JOIN_REQ Join a specific parent on a network