ZDO_StartNetworkReq Function

C

void ZDO_StartNetworkReq(ZDO_StartNetworkReq_t *req);

Description

Performs network formation for coordinator and network join for router or end device.

This function makes a request for starting a network. Before calling this function a device cannot participate in network interactions with other nodes. If node type is the coordinator, a new network is created, while nodes of the router or the end device type search for and join an existing network.

Before calling the function make sure that certain node and network parameters affecting the result of a network start are set correctly. Node parameters include extended address (#CS_UID), short address (#CS_NWK_ADDR) if static addressing scheme is used, and device type (#CS_DEVICE_TYPE). Network parameters are comprised of channel mask (#CS_CHANNEL_MASK), channel page (#CS_CHANNEL_PAGE), extended PANID (#CS_EXT_PANID), and maximum network depth(#CS_MAX_NETWORK_DEPTH). Special attention should be given to security options. Note that for a coordinator extended PANID must be always set to a notzero value. In the case of a router or an end device it may equal 0, which will cause joining to the first suitable network, while a nonzero value makes it possible to join only a network which PANID equal the specified value.

The argument's ZDO_StartNetworkConf field must contain a pointer to a callback function, typically named ZDO_StartNetworkConf(). Upon successful request completion ZDO_SUCCESS_STATUS is returned. Successful netwrok join will also cause a notification of obtained parent node via ZDO_MgmtNwkUpdateNotf() function reporting ZDO_CHILD_JOINED_STATUS.

\anchor StartNwkStatuses

Response statuses: Accessed via the ZDO_StartNetworkConf_t-status field of the ZDO_StartNetworkReq_t-ZDO_StartNetworkConf callback's argument

-ZDO_SUCCESS_STATUS (0x00) - network start has been completed successfully, the node is now

in the network

-ZDO_AUTHENTICATION_FAIL_STATUS (0x09) - authentication has failed after joining a secured

network (due to absent link key, no response from the TC in time, fail in SKKE procedure, etc.).

-NWK_STARTUP_FAILURE_STATUS (0xC4) - the coordinator has failed to perform active scanning

(intended to detect other networks and select a non-conflicting short PANID)

-NWK_NO_NETWORKS_STATUS (0xCA) - no suitable parents have been detected when joining via

association, or potential parents are found but joining to them has been unsuccessful

-NWK_NOT_PERMITTED_STATUS (0xC3) - not suitable parents have been detected when rejoining

the network (extended PANID is known, or static addressing mode is used), or potential parents are found but rejoining them has been unsuccessful

-MAC_NO_BEACON_STATUS (0xEA) - no devices have been detected: no beacons have

been received during scanning

Parameters

ParamDescription
reqDetermines the network parameters for join and formation

Returns

None