Network deployment functions
The ZDO Network Deployment functions are used to start the ZigBee PRO stack, and allow devices to join the network and bind to each other, as well as leave the network.
The functions are listed below.
Function page
Note: The ZDO initialization and start stack functions use network parameter values that have been pre-set and saved using the steps described in Chapter 13, ZPS Configuration Editor.
Parent topic:Network deployment functions
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
ZPS_vDefaultStack
void ZPS\_vDefaultStack\(void\);
Description
This function can be used to reset the ZigBee PRO stack to its default state. It removes previous context data for the stack, but leaves NWK layer frame counters intact.
Note: After calling this function, all security keys must be re-configured.
Parameters None
Returns None
Parent topic:Network deployment functions
ZPS_eAplZdoGetDeviceType
ZPS\_teZdoDeviceType ZPS\_eAplZdoGetDeviceType\(void\);
Description
This function can be used to obtain the ZigBee node type (Coordinator, Router, or End Device) of the local node.
Parameters
None
Returns
ZigBee node type, one of:
ZPS_ZDO_DEVICE_COORD (Coordinator)
ZPS_ZDO_DEVICE_ROUTER (Router)
ZPS_ZDO_DEVICE_ENDDEVICE (End Device)
Parent topic:Network deployment functions
ZPS_eAplZdoDiscoverNetworks
ZPS\_teStatus ZPS\_eAplZdoDiscoverNetworks\(uint32 u32ChannelMask\);
Description
This function can be used by a Router or End Device to initiate a network discovery
that is, to find a network to join.
A network discovery is performed when the stack is started using the function ZPS_eAplZdoStartStack(). The function ZPS_eAplZdoDiscoverNetworks() can be used to perform subsequent network discoveries (for example, if the initial search did not yield any suitable networks).
As part of this function call, you must specify a value which indicates the 2400-MHz radio channels (numbered 11 to 26) to be used in the network search. There are two ways of setting this parameter:
A single value in the range 11 to 26 can be specified, indicating that the corresponding channel (and no other) must be used - for example, 12 indicates use channel 12.
A 32-bit mask can be used to specify a set of channels that the device will scan to find a network - each of bits 11 to 26 represents the corresponding radio channel, where the channel will be included in the scan if the bit is set to 1 (and excluded if cleared to 0). Therefore, the value 0x07FFF800 represents all channels.
Note: If an invalid value is specified for this parameter, the default value of 0x07FFF800 (all channels) will be used.
If this function successfully initiates a network discovery, ZPS_E_SUCCESS will be returned. The network discovery results will then be reported through the event ZPS_EVENT_NWK_DISCOVERY_COMPLETE (for details of this event, refer to Section 7.2.2.9). This includes a list of the detected networks and the index (in the list) of the recommended network to join. You should then call ZPS_eAplZdoJoinNetwork() to join the desired network.
Parameters
u32ChannelMask Radio channel(s) for network discovery (see above)
Returns
ZPS_E_SUCCESS
(network discovery started)
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:Network deployment functions
ZPS_eAplZdoJoinNetwork
ZPS\_teStatus ZPS\_eAplZdoJoinNetwork\(ZPS\_tsNwkNetworkDescr \*psNetworkDescr\);
Description
This function can be used by a Router or End Device to send a request to join a particular network, following a network discovery.
The required network is specified using its network descriptor, obtained in a ZPS_EVENT_NWK_DISCOVERY_COMPLETE
event which results from a network discovery previously implemented using ZPS_eAplZdoStartStack() or ZPS_eAplZdoDiscoverNetworks(). For details of this event, refer to ZPS_tsAfNwkDiscoveryEvent.
If the join request is successfully sent, the function will return ZPS_E_SUCCESS (note that this does not mean that device has joined the network). The result of the join request will then be reported through a stack event (see Events for details of these events):
If the device successfully joined the network as a Router, the event ZPS_EVENT_NWK_JOINED_AS_ROUTER is generated. The allocated 16-bit network address of the Router is returned as part of this stack event.
If the device successfully joined the network as an End Device, the event ZPS_EVENT_NWK_JOINED_AS_ENDDEVICE is generated. The allocated 16-bit network address of the End Device is returned as part of this stack event.
If the join request was unsuccessful, the event ZPS_EVENT_NWK_FAILED_TO_JOIN is generated.
Note: Note that nodes can join a ZigBee PRO network to a maximum depth of 15 (levels below the Coordinator).
Parameters
*psNetworkDescr Pointer to network descriptor of network to join.
Returns
ZPS_E_SUCCESS (join request successfully sent)
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:Network deployment functions
ZPS_eAplZdoRejoinNetwork
**ZPS\_teStatus ZPS\_eAplZdoRejoinNetwork\(bool\_t bWithDiscovery\);**
This function can be used by an active Router or End Device to send a request to rejoin its previous network. The function should be called if the application detects that it has lost its connection to the network - this is indicated by an excessive number of failed communications (for example, with many missing acknowledgments).
Options are provided to first perform a network discovery to find potential parents to join or simply rejoin the previous parent.
If the rejoin request is successfully sent, the function returns ZPS_E_SUCCESS. Note that this does not mean that device has rejoined the network. The result of the rejoin request is then reported through a stack event (see Section 10.1 for details of these events):
If the device successfully rejoined the network as a Router, the event ZPS_EVENT_NWK_JOINED_AS_ROUTER is generated.
If the device successfully rejoined the network as an End Device, the event ZPS_EVENT_NWK_JOINED_AS_ENDDEVICE is generated.
If the rejoin request was unsuccessful, the event ZPS_EVENT_NWK_FAILED_TO_JOIN is generated.
In the case of a successful rejoin, the node will retain its previously allocated 16-bit network address.
Note that the ‘permit joining’ status of the potential parent is ignored during a rejoin.
Parameters
bWithDiscovery Specifies whether a network discovery is required:
TRUE - perform network discovery before rejoining
FALSE - rejoin previous parent
TRUE - perform network discovery before rejoining
FALSE - rejoin previous parent
ZPS_E_SUCCESS (rejoin request successfully sent)
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:Network deployment functions
ZPS_eAplZdoDirectJoinNetwork
ZPS_teStatus ZPS_eAplZdoDirectJoinNetwork( uint64 u64Addr, uint16 u16Addr, uint8 u8Capability);
Description
This function can be used on a Router and on the Coordinator to pre-determine the child nodes that will directly join it. The function is called to register each child node separately, and the IEEE/MAC and network addresses of the child node must be specified. The function adds the registered node to its Neighbor table (it actually adds the node’s IEEE/MAC address to the MAC Address table and then includes the index of this address in a Neighbor table entry for the node).
The function must be called only when the parent node is fully up and running in the network. Since the child node has not yet joined the network but is in the Neighbor table, it will be perceived by the parent as having been orphaned. Therefore, when the child node attempts to join the network, it must perform a rejoin as an orphan by calling the function ZPS\_eAplZdoOrphanRejoinNetwork\(\)
.
Note: You should only modify the Neighbor table using this function and never write to it directly.
Parameters
u64Addr IEEE/MAC address of child node to be registered
u16Addr Network address of child node to be registered
u8Capability A bitmap indicating the operational capabilities of the child node - this bitmap is detailed in Table in section ZPS_tsAfNwkJoinIndEvent.
Returns
ZPS_E_SUCCESS
(child node successfully registered)ZPS_APL_APS_E_ILLEGAL_REQUEST
(address 0x0, address 0xFFFFFFFFFFFFFFFF, own address, ZDO busy)ZPS_NWK_ENUM_ALREADY_PRESENT
ZPS_NWK_ENUM_NEIGHBOR_TABLE_FULL
Parent topic:Network deployment functions
ZPS_eAplZdoOrphanRejoinNetwork
ZPS_teStatus ZPS_eAplZdoOrphanRejoinNetwork(void);
This function can be used by an orphaned node to attempt to rejoin the network - the orphaned node may be an End Device or a Router. The function should also be used for a first-time join for which the parent has been pre-determined using the function ZPS_eAplZdoDirectJoinNetwork().
The function starts the stack on the node. Therefore, when this function is used, there is no need to explicitly start the stack using ZPS_eAplZdoStartStack().
If the rejoin request is successfully sent, the function will return ZPS_E_SUCCESS (note that this does not mean that device has rejoined the network). The result of the rejoin request will then be reported through a stack event (see Section 10.1 for details of these events):
If the device successfully rejoined the network as a Router, the event
ZPS_EVENT_NWK_JOINED_AS_ROUTER
is generated.If the device successfully rejoined the network as an End Device, the event
ZPS_EVENT_NWK_JOINED_AS_ENDDEVICE
is generated.If the rejoin request was unsuccessful, the event
ZPS_EVENT_NWK_FAILED_TO_JOIN
is generated.
In the case of a successful rejoin of a genuinely orphaned node, the node will retain its previously allocated 16-bit network address.
Note: The ‘permit joining’ status of the potential parent is ignored during a rejoin.
Parameters
None
Parent topic:ZPS_eAplZdoOrphanRejoinNetwork
Returns
ZPS_E_SUCCESS
(rejoin request successfully sent)ZPS_APL_APS_E_ILLEGAL_REQUEST
(missing EPID, called from Coordinator, ZDO busy)
Parent topic:ZPS_eAplZdoOrphanRejoinNetwork
Parent topic:Network deployment functions
ZPS_eAplZdoPermitJoining
ZPS_teStatus ZPS_eAplZdoPermitJoining(
uint8 u8PermitDuration);
Description
This function can be used on a Router or the Coordinator to control whether new child nodes are allowed to join it - that is, to set the node’s ‘permit joining’ status. The function can be used to enable joining permanently or for a fixed duration, or to disable joining (permanently).
The specified parameter value determines the ‘permit joining’ status, as follows:
0
: Disables joining1- 254
: Enables joining for specified time interval, in seconds255
: Enables joining permanently
For example, if the parameter is set to 60, joining is enabled for the next 60 seconds and then automatically disabled.
Note: The ‘permit joining’ setting of a device is ignored during a join attempt in which a non-zero Extended PAN ID is specified on the joining device and during any rejoin attempt.
Parent topic:ZPS_eAplZdoPermitJoining
Parameters
u8PermitDuration Time duration, in seconds, for which joining will be permitted (see above)
Parent topic:ZPS_eAplZdoPermitJoining
Returns
ZPS_E_SUCCESS
(‘permit joining’ status successfully set)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_eAplZdoPermitJoining
Parent topic:Network deployment functions
ZPS_u16AplZdoGetNetworkPanId
uint16 ZPS_u16AplZdoGetNetworkPanId(void);
Description
This function obtains the 16-bit PAN ID of the ZigBee network to which the local node currently belongs.
Parent topic:ZPS_u16AplZdoGetNetworkPanId
Parameters
None.
Parent topic:ZPS_u16AplZdoGetNetworkPanId
Returns
PAN ID of current network.
Parent topic:ZPS_u16AplZdoGetNetworkPanId
Parent topic:Network deployment functions
ZPS_u64AplZdoGetNetworkExtendedPanId
uint64 ZPS_u64AplZdoGetNetworkExtendedPanId(void)
Description
This function obtains the 64-bit Extended PAN ID (EPID) of the ZigBee PRO network to which the local node currently belongs.
Parent topic:ZPS_u64AplZdoGetNetworkExtendedPanId
Parameters
None
Parent topic:ZPS_u64AplZdoGetNetworkExtendedPanId
Returns
Extended PAN ID of current network.
Parent topic:ZPS_u64AplZdoGetNetworkExtendedPanId
Parent topic:Network deployment functions
ZPS_u8AplZdoGetRadioChannel
uint8 ZPS_u8AplZdoGetRadioChannel(void);
Description
This function obtains the 2400-MHz band channel in which the local node is currently operating. The channel is represented by an integer in the range 11 to 26.
Parent topic:ZPS_u8AplZdoGetRadioChannel
Parameters
None.
Parent topic:ZPS_u8AplZdoGetRadioChannel
Returns
Radio channel number (in range 11-26).
Parent topic:ZPS_u8AplZdoGetRadioChannel
Parent topic:Network deployment functions
ZPS_eAplZdoBind
ZPS_teStatus ZPS_eAplZdoBind(
uint16 u16ClusterId,
uint8 u8SrcEndpoint,
uint16 u16DstAddr,
uint64 u64DstIeeeAddr,
uint8 u8DstEndpoint);
Description
This function requests a binding to be created between an endpoint on the local node and an endpoint on a remote node. The source endpoint and cluster must be specified, as well as the destination node and endpoint. The destination node is specified using both its 64-bit IEEE (MAC) address and its 16-bit network address.
The binding is added to the binding table on the local node.
A binding to multiple remote endpoints (collected into a group) can be created using the function ZPS_eAplZdoBindGroup().
Parent topic:ZPS_eAplZdoBind
Parameters
u16ClusterId Identifier of cluster on source node to be bound u8SrcEndpoint Number of endpoint (1-240) on source node to be bound u16DstAddr 16-bit network address of destination for binding u64DstIeeeAddr 64-bit IEEE (MAC) address of destination for binding u8DstEndpoint Number of endpoint on destination node to be bound
Parent topic:ZPS_eAplZdoBind
Returns
ZPS_E_SUCCESS (binding successfully created)
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_eAplZdoBind
Parent topic:Network deployment functions
ZPS_eAplZdoUnbind
ZPS_teStatus ZPS_eAplZdoUnbind(
uint16 u16ClusterId,
uint8 u8SrcEndpoint,
uint16 u16DstAddr,
uint64 u64DstIeeeAddr,
uint8 u8DstEndpoint);
Description
This function requests an existing binding to be removed between an endpoint on the local node and an endpoint on a remote node, where this binding was created using the function ZPS_eAplZdoBind(). The source endpoint and cluster must be specified, as well as the destination node and endpoint. The destination node is specified using both its 64-bit IEEE (MAC) address and its 16-bit network address.
The binding is removed from the binding table on the local node.
Parent topic:ZPS_eAplZdoUnbind
Parameters
u16ClusterId Identifier of bound cluster on source node u8SrcEndpoint Number of bound endpoint (1-240) on source node u16DstAddr 16-bit network address of destination for binding u64DstIeeeAddr 64-bit IEEE (MAC) address of destination for binding u8DstEndpoint Number of bound endpoint on destination node
Parent topic:ZPS_eAplZdoUnbind
Returns
ZPS_E_SUCCESS (binding successfully removed)
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_eAplZdoUnbind
Parent topic:Network deployment functions
ZPS_eAplZdoBindGroup
ZPS_teStatus ZPS_eAplZdoBindGroup(
uint16 u16ClusterId,
uint8 u8SrcEndpoint,
uint16 u16DstGrpAddr);
Description
This function requests a binding to be created between an endpoint on the local node and multiple endpoints on remote nodes. The source endpoint and cluster must be specified, as well as the destination nodes/endpoints for the binding, which must be specified using a 16-bit group address, previously set up using ZPS_eAplZdoGroupEndpointAdd().
The binding is added to the binding table on the local node.
Parent topic:ZPS_eAplZdoBindGroup
Parameters
u16ClusterId Identifier of cluster on source node to be bound u8SrcEndpoint Number of endpoint (1-240) on source node to be bound u16DstGrpAddr 16-bit group address of destination group for binding
Parent topic:ZPS_eAplZdoBindGroup
Returns
ZPS_E_SUCCESS (binding successfully created)
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_eAplZdoBindGroup
Parent topic:Network deployment functions
ZPS_eAplZdoUnbindGroup
ZPS_teStatus ZPS_eAplZdoUnbindGroup(
uint16 u16ClusterId,
uint8 u8SrcEndpoint,
uint16 u16DstGrpAddr);
Description
This function requests an existing binding to be removed between an endpoint on the local node and a group of endpoints on remote nodes, where this binding was created using the function ZPS_eAplZdoBindGroup(). The source endpoint and cluster must be specified, as well as the destination nodes/endpoints for the binding, which must be specified using a 16-bit group address.
The binding is removed from the binding table on the local node.
Parent topic:ZPS_eAplZdoUnbindGroup
Parameters
u16ClusterId Identifier of bound cluster on source node
u8SrcEndpoint Number of bound endpoint (1-240) on source node
u16DstGrpAddr 16-bit group address of bound destination group
Parent topic:ZPS_eAplZdoUnbindGroup
Returns
ZPS_E_SUCCESS (binding successfully removed)
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_eAplZdoUnbindGroup
Parent topic:Network deployment functions
ZPS_ePurgeBindTable
ZPS_teStatus ZPS_ePurgeBindTable(void);
Description
This function removes all bindings from the binding table on the local node.
Parent topic:ZPS_ePurgeBindTable
Parameters
None
Parent topic:ZPS_ePurgeBindTable
Returns
ZPS_E_SUCCESS (binding successfully removed)
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_ePurgeBindTable
Parent topic:Network deployment functions
ZPS_eAplZdoPoll
ZPS_teStatus ZPS_eAplZdoPoll(void);
Description
This function can be used by an End Device to poll its parent for pending data.
Since an End Device is able to sleep, messages addressed to the End Device are buffered by the parent for delivery when the child is ready. This function requests this buffered data and should normally be called immediately after waking from sleep.
This function call will trigger a confirmation event, ZPS_EVENT_NWK_POLL_CONFIRM, if the poll request is successfully sent to the parent. The subsequent arrival of data from the parent is indicated by a ZPS_EVENT_APS_DATA_INDICATION event. Any messages forwarded from the parent should then be collected using the function ZQ_bZQueueReceive().
Parent topic:ZPS_eAplZdoPoll
Parameters
None
Parent topic:ZPS_eAplZdoPoll
Returns
ZPS_E_SUCCESS
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_eAplZdoPoll
Parent topic:Network deployment functions
ZPS_eAplZdoLeaveNetwork
ZPS_teStatus ZPS_eAplZdoLeaveNetwork(
uint64 u64Addr,
bool bRemoveChildren,
bool bRejoin);
Description
This function can be used to request a node to leave the network. The leaving node can be a child of the requesting node or can be the requesting node itself (excluding the Coordinator).
The node being asked to leave the network is specified by means of its IEEE (MAC) address (or zero, if a node is requesting itself to leave the network). You must also:
Use the parameter bRemoveChildren to specify whether children of the leaving node must leave their parent - if this is the case, the leaving node will automatically call ZPS_eAplZdoLeaveNetwork() for each of its children. This parameter must always be set to FALSE when the function is called on an End Device (as there are no children).
Use the parameter bRejointo specify whether the leaving node must attempt to rejoin the network (probably via another parent) immediately after leaving.
Note: If you wish to move a whole network branch from under the requesting node to a different parent node, set bRemoveChildren
to FALSE and bRejoin
to TRUE.
If this function successfully initiates the removal of a node, ZPS_E_SUCCESS will be returned. Subsequently, when the removal is complete, the stack event ZPS_EVENT_NWK_LEAVE_CONFIRM is generated. For details of this event, refer to Section 7.2.2.12.
Parent topic:ZPS_eAplZdoLeaveNetwork
Parameters
u64Addr 64-bit IEEE (MAC) address of node to leave network (zero value will cause requesting node to leave network)
bRemoveChildren Boolean value indicating whether children of leaving node must leave their parent:
TRUE: Children to leave FALSE: Children not to leave
bRejoin Boolean value indicating whether leaving node must attempt to rejoin network immediately after leaving:
TRUE: Rejoin network immediately FALSE: Do not rejoin network
Parent topic:ZPS_eAplZdoLeaveNetwork
Returns
ZPS_E_SUCCESS (removal of node successfully started)
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_eAplZdoLeaveNetwork
Parent topic:Network deployment functions
ZPS_vNwkNibSetLeaveAllowed
void ZPS_vNwkNibSetLeaveAllowed(void *pvNwk,
bool bLeave);
Description
This function can be called on a Router or End Device to determine whether the device should leave the network on receiving a leave request. It has no effect on a Coordinator.
If called with bLeave set to TRUE, the device obeys a leave request.
If called with bLeave set to FALSE, the device ignores a leave request.
Parent topic:ZPS_vNwkNibSetLeaveAllowed
Parameters
pvNwk Pointer to NWK layer instance
bLeaveBoolean value indicating whether the device leaves the network when requested or ignores leave request messages:
TRUE - Obey leave request messages.
FALSE - Ignore leave request messages.
Parent topic:ZPS_vNwkNibSetLeaveAllowed
Returns
None
Parent topic:ZPS_vNwkNibSetLeaveAllowed
Parent topic:Network deployment functions
ZPS_vNwkNibSetLeaveRejoin
void ZPS_vNwkNibSetLeaveRejoin(void *pvNwk,
bool bRejoin);
Description
This function can be called on a Router or End Device to configure the device to automatically rejoin after leaving the network, even when a ‘leave without rejoin’ was requested.
If called with bRejoin set to TRUE, the device will rejoin following a leave.
If called with bRejoin set to FALSE, the device will not rejoin following a leave.
Parent topic:ZPS_vNwkNibSetLeaveRejoin
Parameters
pvNwk Pointer to NWK layer instance
bLeave Boolean value indicating whether the device will rejoin the network following a leave:
TRUE - Rejoin the network
FALSE - Do not rejoin the network
Parent topic:ZPS_vNwkNibSetLeaveRejoin
Returns
None
Parent topic:ZPS_vNwkNibSetLeaveRejoin
Parent topic:Network deployment functions
ZPS_vSetTablesClearOnLeaveWithoutRejoin
void ZPS_vSetTablesClearOnLeaveWithoutRejoin(
bool_t bClear);
Description
This function can be called on a Router or End Device to configure whether various tabulated context data must be cleared from the node when it leaves the network without the intention to rejoin.
By default, the Neighbor table, Binding table and Group table are cleared on a Router, and the network key is cleared on a Router and End Device. In addition, other devices remove the node from their Binding tables on detecting the leave request (without the rejoin flag set).
This function can be used to over-ride this behavior in order to preserve this table data. It can also be used to later reinstate the default behavior.
Parent topic:ZPS_vSetTablesClearOnLeaveWithoutRejoin
Parameters
bClear Boolean value indicating whether the node should clear the table data when leaving the network without a future rejoin:
TRUE - Clear table data (default behavior)
FALSE - Do not clear table data
Parent topic:ZPS_vSetTablesClearOnLeaveWithoutRejoin
Returns
None
Parent topic:ZPS_vSetTablesClearOnLeaveWithoutRejoin
Parent topic:Network deployment functions
ZPS_vNtSetUsedStatus
void ZPS_vNtSetUsedStatus(
void *pvNwk,
ZPS_tsNwkActvNtEntry *psActvNtEntry,
bool_t bStatus);
Description
This function can be used to set the status of a local Neighbor Table to either ‘used’ or ‘unused’:
Setting the status of an entry to unused effectively removes the entry from the table.
Setting the status of an entry to used effectively adds an entry to the table.
When adding an entry to the table, it is first necessary for the application to find an entry marked unused. The entry can then be populated with data and marked as used via this function.
Parent topic:ZPS_vNtSetUsedStatus
Parameters
pvNwk Pointer to NWK layer instance
psActvNtEntryPointer to Neighbor Table entry to access (this must be populated with data when adding a new entry to the table)
bStatus Entry status to be set:
TRUE - Set entry status to ‘used’
FALSE - Set entry status to ‘unused’
Parent topic:ZPS_vNtSetUsedStatus
Returns
None
Parent topic:ZPS_vNtSetUsedStatus
Parent topic:Network deployment functions
ZPS_vNwkSendNwkStatusCommand
void ZPS_vNwkSendNwkStatusCommand(
void *pvNwk,
uint16 u16DstAddress,
uint16 u16TargetAddress,
uint8 u8CommandId,
uint8 u8Radius);
Description
This function can be used to send a network status command to another node. For example, it can be used by an End Device to report a routing problem (concerning a remote node) to its parent.
Parent topic:ZPS_vNwkSendNwkStatusCommand
Parameters
pvNwk Pointer to NWK layer instance
u16DstAddress Network address of the remote node to which the status command relates (for example, the node for which a routing problem is being reported)
u16TargetAddress Network address of the node to which the status command is to be sent (for example, the parent of the local node)
u8CommandId Value representing the network status command to be sent (the possible values are provided in the ZigBee PRO specification)
u8Radius Maximum number of hops permitted to target node (zero value specifies that default maximum is to be used)
Parent topic:ZPS_vNwkSendNwkStatusCommand
Returns
None
Parent topic:ZPS_vNwkSendNwkStatusCommand
Parent topic:Network deployment functions
ZPS_eAplZdoRegisterZdoLeaveActionCallback
void ZPS_eAplZdoRegisterZdoLeaveActionCallback(
void *fnPtr);
Description
This function can be used to register a user-defined callback function that will be invoked when a leave request, a management leave request or a remove device request (from a remote node, normally the Trust Centre) is received by the local node. The callback function must determine whether the request must be obeyed or ignored by the stack - this decision may depend on the originator of the request.
The prototype of the callback function is as follows:
bool_t ZPS_bPerformLeaveActionDecider(uint8 u8Value ,
uint64 u64Address, uint8 u8Flags);
where:
u8Value is an enumerated value indicating the type of request - one of: ZPS_LEAVE_ORIGIN_NLME (NLME-LEAVE.request from NWK layer) ZPS_LEAVE_ORIGIN_MGMT_LEAVE (management leave request) ZPS_LEAVE_ORIGIN_REMOVE_DEVICE (remove request from remote node)
u64Address is the IEEE/MAC address of the node that issued the request
u8Flags is a user-defined bitmap containing flagged information
The callback function must return TRUE to allow or FALSE to disallow the requested leave.
Parent topic:ZPS_eAplZdoRegisterZdoLeaveActionCallback
Parameters
fnPtr: Pointer to user-defined callback function to be registered.
Parent topic:ZPS_eAplZdoRegisterZdoLeaveActionCallback
Returns
None
Parent topic:ZPS_eAplZdoRegisterZdoLeaveActionCallback
Parent topic:Network deployment functions
Parent topic:ZDO API functions