Radio Channels

XBee ZigBee module works on the 2.4 GHz band, so there are 16 channels that can be used. These channels are explained in the "Channel" section.
When starting a network, the Coordinator performs an energy scan to find the channel with less energy. When joining a network, the router or end device performs an active scan to find any coordinator or router available to join. There are some parameters involved in this channel election.

Scan Channels

List of channels to scan. If it is a Coordinator, the list of channels to choose from prior to starting the network. If its a router/end device, the list of channels to scan to find a Coordinator/Router to join the network. Setting this parameter to 0xFFFF, all the channels will be scanned.
Example of use
Related variables:
xbeeZB.scanChannels[0-1] → stores the list of channels to scan

Scan Duration

Scan duration exponent. If it is a Coordinator, duration of the Active and Energy Scans (on each channel) that are used to determine an acceptable channel and PAN ID for the Coordinator to startup on. If it is a Router/End Device, duration of Active Scan (on each channel) used to locate an available Coordinator/Router to join during Association.
Scan time is measured as: (channels to scan) * (2\^SD) * 15.36 ms.
Example of use:
xbeeZB.setDurationEnergyChannels(3); // Set exponent: scan time=channels*122,88ms
xbeeZB.getDurationEnergyChannels(); // Get exponent
Related variables:
xbeeZB.timeEnergyChannel → stores the exponent