5.1.2.19 ZDO_StartNetworkReq Function
Syntax
void ZDO_StartNetworkReq(ZDO_StartNetworkReq_t *req);
Description
This function initiates network formation for a coordinator and network joining for a router or end device, thereby enabling the device to start interacting with other nodes in the network. The process involves:
- For a coordinator – Creating a new network
- For a router or end device – Searching for and joining an existing network
Before executing this function, ensure the following parameters are correctly set:
- Node parameters:
- Extended address (
CS_UID
) - Short address (
CS_NWK_ADDR
) for static addressing - Device type (
CS_DEVICE_TYPE
)
- Extended address (
- Network parameters:
- Channel mask (
CS_CHANNEL_MASK
) - Channel page (
CS_CHANNEL_PAGE
) - Extended PANID (
CS_EXT_PANID
) must be non-zero for coordinators - Maximum network depth (
CS_MAX_NETWORK_DEPTH
)
- Channel mask (
- Carefully configure the security options
Note: Before initiating the network formation or joining process, it is crucial to set specific parameters correctly:
The - For a coordinator – The extended PANID (
CS_EXT_PANID
) must always be set to a non-zero value. - For a router or end device:
- An extended PANID of 0 allows the device to join the first suitable network it finds.
- A non-zero extended PANID restricts the device to join only a network with a matching PANID.
ZDO_StartNetworkConf
argument must include a pointer to a callback function, typically ZDO_StartNetworkConf()
. Successful network formation or joining triggers: - A
ZDO_SUCCESS_STATUS
return - A
ZDO_CHILD_JOINED_STATUS
notification viaZDO_MgmtNwkUpdateNotf()
for a successful network join
The response statuses, accessed via the
ZDO_StartNetworkConf_t-status
field of the ZDO_StartNetworkReq_t-ZDO_StartNetworkConf
callback’s argument, are as follows: ZDO_SUCCESS_STATUS (0x00)
– Network start is successful; the node has joined the networkZDO_AUTHENTICATION_FAIL_STATUS (0x09)
– Authentication failed after attempting to join a secured networkNWK_STARTUP_FAILURE_STATUS (0xC4)
– The coordinator failed to perform active scanningNWK_NO_NETWORKS_STATUS (0xCA)
– No suitable parents found for joining via associationNWK_NOT_PERMITTED_STATUS (0xC3)
– No suitable parents found for rejoining the networkMAC_NO_BEACON_STATUS (0xEA)
– No devices detected due to the absence of received beacons during scanning
Input Parameters
Parameter Name | Description |
---|---|
req | Determines the network parameters for join and formation |
Return Type and Values
- None