ZPS_eAplZdoStartStack

ZPS\_teStatus ZPS\_eAplZdoStartStack\(void\);

Description

This function starts the ZigBee PRO stack. The steps taken depend on the node type:

  • If the device is the Coordinator, this function starts the network formation process.

  • If the device is a Router or End Device, this function starts the network discovery process - that is, the device searches for a network to join.

When the stack starts, the 2400 MHz radio channel to be used by the device is selected. The channels (in the range 11 to 26) available to the device should be specified in advance using the ZPS Configuration Editor (see Chapter 13) and can be either of the following:

  • A fixed channel

  • A set of channels for a channel scan:

    • If the device is the Coordinator, this is the set of channels that the device scans to find a suitable operating channel for the network.

    • If the device is a Router or End Device, this is the set of channels that the device scans to find a network to join.

If this function successfully initiates network formation or discovery, it returns ZPS_E_SUCCESS. Subsequent results from this process are then reported through stack events (see Events for details of these events):

  • If the Coordinator successfully creates a network, the event ZPS_EVENT_NWK_STARTED is generated. Otherwise, the event ZPS_EVENT_NWK_FAILED_TO_START is generated.

  • When the network discovery process for a Router or End Device is complete, the subsequent actions depend on the Extended PAN ID (EPID) that is pre-set using the ZPS Configuration Editor:

    • If a zero EPID value was pre-set, the stack event ZPS_EVENT_NWK_DISCOVERY_COMPLETE is generated. This includes a list of the detected networks and the index (in the list) of the recommended network to join. You can then call ZPS_eAplZdoJoinNetwork() to join the desired network.

    • If a non-zero EPID value was pre-set, the device automatically attempts to join the network with this EPID, provided that such a network has been discovered. Note that the ‘permit joining’ setting of the potential parent is ignored.

The maximum depth (number of levels below the Coordinator) of the network is 15.

Parameters

None

Parent topic:ZPS_eAplZdoStartStack

Returns

  • ZPS_E_SUCCESS (stack started and network formation/discovery begun)

  • 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_eAplZdoStartStack

Parent topic:Network deployment functions