ZIC2410 User Guide Network Layer API Reference 0005-05-08

ZIC2410 Series
ZIC2410 User Guide
Network Layer API Reference
0005-05-08-08-001
(Rev B)
ZIC2410 Network Layer API Reference
Table of Contents
1 2 3 4 INTRODUCTION ................................................................................4 ZIGBEE2006 LAYER AND FRAME STRUCTURE .........................4 NWK FRAME FORMAT ....................................................................5 NWK STATUS AND CONSTANTS...................................................6 4.1 NWK STATUS ............................................................................................... 6 4.2 NWK CONSTANTS ....................................................................................... 7 5 NETWORK LAYER PRIMITIVES ......................................................8 5.1 NLDE-DATA ................................................................................................. 10 5.1.1 NLDE-DATA.req ................................................................................................ 10 5.1.2 NLDE-DATA.con ................................................................................................ 10 5.1.3 NLDE-DATA.ind ................................................................................................. 10 5.2 NLME-NETWORK-DISCOVERY ................................................................. 11 5.2.1 NLME-NETWORK-DISCOVERY.req .................................................................. 11 5.2.2 NLME-NETWORK-DISCOVERY.con ................................................................. 11 5.3 NLME-NETWORK-FORMATION ................................................................. 13 5.3.1 NLME-NETWORK-FORMATION.req ................................................................ 13 5.3.2 NLME-NETWORK-FORMATION.con................................................................ 13 5.4 NLME-PERMIT-JOIN ................................................................................... 13 5.4.1 NLME-PERMIT-JOIN.req .................................................................................. 13 5.4.2 NLME-PERMIT-JOIN.con .................................................................................. 13 5.5 NLME-START-ROUTER .............................................................................. 14 5.5.1 NLME-START-ROUTER.req.............................................................................. 14 5.5.2 NLME-START-ROUTER.con ............................................................................. 14 5.6 NLME-JOIN.................................................................................................. 15 5.6.1 NLME-JOIN.req ................................................................................................. 15 5.6.2 NLME-JOIN.con ................................................................................................ 15 5.6.3 NLME-JOIN.ind ................................................................................................. 15 5.7 NLME-DIRECT-JOIN ................................................................................... 16 5.7.1 NLME-DIRECT-JOIN.req................................................................................... 16 5.7.2 NLME-DIRECT-JOIN.con .................................................................................. 16 5.8 NLME-LEAVE .............................................................................................. 17 5.8.1 NLME-LEAVE.req.............................................................................................. 17 5.8.2 NLME-LEAVE.con ............................................................................................. 17 5.8.3 NLME-LEAVE.ind .............................................................................................. 17 5.9 NLME-RESET .............................................................................................. 18 5.9.1 NLME-RESET.req ............................................................................................. 18 5.9.2 NLME-RESET.con ............................................................................................. 18 5.10 NLME-SYNC ................................................................................................ 18 5.10.1 NLME-SYNC.req ............................................................................................... 18 5.10.2 NLME-SYNC.con .............................................................................................. 18 5.10.3 NLME-SYNC.ind ............................................................................................... 18 5.11 NLME-GET................................................................................................... 18 5.11.1 NLME-GET.req .................................................................................................. 18 5.11.2 NLME-GET.con ................................................................................................. 18 Rev B
Document No. 0005-05-08-08-001
Page 2 of 25
ZIC2410 Network Layer API Reference
5.12 NLME-GET-TABLE ...................................................................................... 19 5.12.1 NLME-GET-TABLE.req ...................................................................................... 19 5.12.2 NLME-GET-TABLE.con ..................................................................................... 19 5.13 NLME-SET ................................................................................................... 20 5.13.1 NLME-SET.req .................................................................................................. 20 5.13.2 NLME-SET.con .................................................................................................. 20 5.14 NLME-SET-TABLE ...................................................................................... 21 5.14.1 NLME-SET-TABLE.req ...................................................................................... 21 5.14.2 NLME-SET-TABLE.con ..................................................................................... 21 5.15 NLME-ROUTE-DISCOVERY ....................................................................... 21 5.15.1 NLME-ROUTE-DISCOVERY.req....................................................................... 21 5.15.2 NLME-ROUTE-DISCOVERY.con ...................................................................... 21 5.16 NLME-ROUTE-ERROR ............................................................................... 22 5.16.1 NLME-ROUTE-ERROR.ind ............................................................................... 22 5.17 NLME-FORCE-JOIN .................................................................................... 22 5.17.1 NLME-FORCE-JOIN.req ................................................................................... 22 5.17.2 NLME-FORCE-JOIN.con .................................................................................. 23 6 NWK FUNCTION .............................................................................23 6.1 NETWORK BROADCASTS ........................................................................ 23 6.2 CAPACITY OF A PARENT ......................................................................... 23 6.3 NWK ADDRESS ASSIGNMENT................................................................. 24 7 REVISION HISTORY .......................................................................25 Rev B
Document No. 0005-05-08-08-001
Page 3 of 25
ZIC2410 Network Layer API Reference
1 INTRODUCTION
This document explains the Network (NWK) Layer functions and fields and the associated
Application Programming Interface (API) of the CEL ZigBee Stack.
The CEL ZigBee Stack is a ZigBee Stack Library, provided by CEL which supports both IEEE
802.15.4 and ZigBee2006 Standards.
The CEL ZigBee Stack includes API functions to support the functionality defined in the
ZigBee™ standard and the communication functions defined in IEEE 802.15.4.
2 ZIGBEE2006 LAYER AND FRAME STRUCTURE
Figure 1 and Figure 2 show ZigBee™2006 layer and frame structure for each layer.
Figure 1 – ZigBee2006 Layer
Figure 2 – ZigBee2006 Frame Structure
Rev B
Document No. 0005-05-08-08-001
Page 4 of 25
ZIC2410 Network Layer API Reference
3 NWK FRAME FORMAT
As shown in Figure 2 and in Table 1, the NWK frame consists of a header and a payload:
Table 1 – NWK Frame Format and Field Descriptions
NWK Header
NWK
Payload
var
Octet: 1
2
2
1
1
0/8
0/8
0/1
var
Frame
Dst
Src
Seq
Dst
Src
Multi
Src
Radius
NSDU
Control
Addr
Addr
Num
IEEE
IEEE
Ctrl
Route
Field Name
Description
This field shows the frame characteristic:
bit [15:13]: Reserved. It is always to be 0.
bit [12]: SrcIEEEPresent. 1 indicates that there is a SrcIEEE field in the header.
bit [11]: DstIEEEPresent. 1 indicates that there is a DstIEEE field in the header.
bit [10]: SourceRoute. 1 indicates that there is a SrcRoute field in the frame header.
FrameControl
bit [9]: Security. 1 = NWK security operations enabled.
bit [8]: MulticastFlag. If 1, the frame is a multicast frame, and NWK hdr contains a MultiCtrl field.
bit [7:6]: DiscoverRoute. It determines whether routing is enabled or not.
0 = Suppress, 1 = Enable, 2 = Force. This field is always 0 for a NWK Command frame.
bit [5:2]: ProtocolVersion. 0 = ZigBee2004, 1 = ZigBee2005, 2 = ZigBee2006.
bit [1:0]: FrameType. 0 = NWK Data, 1 = NWK Command
If MulticastFlag (in FrameControl) = 0, holds the destination NWK Address or the Broadcast
DstAddr
Address.
If MulticastFlag (in FrameControl) = 1, holds the Multicast GroupID.
SrcAddr
the NWK Address of Source.
Range (in number of hops) in a radius-limited transmission. Each receiving device decreases the
Radius
radius by 1.
SeqNum
Sequence number used to distinguish the NWK frame
DstIEEE
64-bit IEEE Address of destination
SrcIEEE
64-bit IEEE Address of Source
Multicast Control:
bit [7:5]: MaxNonmemberRadius. The maximum value of the NonmemberRadius.
bit [4:2]: NonmemberRadius
For a member mode multicast, the number of hops to be relayed by non-member devices.
MultiCtrl
Member devices retransmit after updating this field to the value in MaxNonmemberRadius.
bit [1:0]: Multicast Mode.
0 = Non-Member Mode. Multicast is from non-member device to member device.
1 = Member Mode. Multicast is from member device to member device.
Octet: 1
1
Variable (2Byte * N)
Relay Count
Relay Index
Relay List
SrcRoute
Number of items in Index of next relay
List of Relay Addresses (ordered from closest to the
the Relay List
on the relay list
destination to closest to the originator).
NWK Payload
NSDU
NWK data.
Rev B
Document No. 0005-05-08-08-001
Page 5 of 25
ZIC2410 Network Layer API Reference
4 NWK STATUS AND CONSTANTS
4.1
NWK STATUS
Table 2 – Network Status Fields
Value
Description
SUCCESS
0x00 Operation was successful.
INVALID_PARAMETER
0xC1 The parameter is invalid or out-of-range
INVALID_REQUEST
0xC2 The request is invalid or cannot be executed
NOT_PERMITTED
0xC3 An NLME-JOIN.request has been disallowed
An NLME-NETWORK-FORMATION.request has failed to start a
STARTUP_FAILURE
0xC4
network.
The target device is already present in the neighbor table of the device
ALREADY_PRESENT
0xC5
on which the NLMEDIRECT- JOIN.request was issued.
SYNC_FAILURE
0xC6 Used to indicate that an NLME-SYNC.req has failed at the MAC layer.
An NLME-JOIN-DIRECTLY.request has failed because there is no
NEIGHBOR_TABLE_FULL
0xC7
more room in the neighbor table.
An NLME-LEAVE.request has failed because the device addressed in
UNKNOWN_DEVICE
0xC8
the parameter list is not in the neighbor table of the issuing device
An NLME-GET.request or NLME-SET.request has been issued with
UNSUPPORTED_ATTRIBUTE 0xC9
an unknown attribute identifier.
An NLME-JOIN.request has been issued in an environment where no
NO_NETWORKS
0xCA
networks are detectable.
LEAVE_UNCONFIRMED
0xCB An NLME-LEAVE.request has not been confirmed.
Security processing has been attempted on an outgoing frame, and
MAX_FRM_CNTR
0xCC
has failed because the frame counter has reached its maximum value.
Security processing has been attempted on an outgoing frame, and
NO_KEY
0xCD
has failed because no key was available with which to process it.
Security processing has been attempted on an outgoing frame, and
BAD_CCM_OUTPUT
0xCE
has failed because the security engine produced erroneous output.
An attempt to discover a route has failed due to a lack of routing table
NO_ROUTING_CAPACITY
0xCF
or discovery table capacity.
An attempt to discover a route has failed due to a reason other than a
ROUTE_DISCOVERY_FAILED 0xD0
lack of routing capacity.
An NLDE-DATA.request has failed due to a routing failure on the
ROUTE_ERROR
0xD1
sending device.
An attempt to send a broadcast frame or member mode multicast has
BT_TABLE_FULL
0xD2
failed due to the fact that there is no room in the BTT.
An NLDE-DATA.request has failed due to insufficient buffering
available.
FRAME_NOT_BUFFERED
0xD3
A non-member mode multicast frame was discarded pending route
discovery.
Additional NWK Status fields (defined by CEL)
NOT_DEFINED
0xD7 The command is not defined in the spec.
NQ_BUSY
0xDB All queues for the NWK layer are being used.
NO_IMPLEMENT
0xDC The function is not implemented.
NLME-ROUTE-DISCOVERY should be performed first because the
ROUTE_FIRST
0xDE
destination router does not exist.
It is used when a confirmation is returned before the Request process is
FAKE_RETURN
0xDF completed. This confirmation should be ignored. When the
confirmation process is completed, the status will change.
Name
Rev B
Document No. 0005-05-08-08-001
Page 6 of 25
ZIC2410 Network Layer API Reference
4.2
NWK CONSTANTS
Name
Value
nwkcCoordCapa
nwkcDefaultSecLevel
nwkcDiscRetryLimit
nwkcMaxDepth
nwkcMinHeadOverhead
nwkcProtocolVersion
3
3
15
8
2
nwkcWaitBeforeValid
1280
nwkcRepairThreshold
3
nwkcRouteDiscTime
nwkcMaxBroadcastJitter
nwkcInitRREQRetry
nwkcRREQRetry
nwkcRREQRetryInterval
nwkcMinRREQJitter
nwkcMaxRREQJitter
nwkcMaxNSDU
Rev B
10000
64
3
2
254
1
64
96
Table 3 – Network Constants
Description
Enable/Disable coordinator. If ‘1’, a device can be coordinator. The value is
determined when being built.
Security level used in NWK ENC-MIC-64.
The number of retries for Route discovery.
Maximum number of hops from the coordinator to the furthest end device.
Minimum length of NWK header added on NSDU.
ZigBee2006 NWK Protocol version.
Duration between the point which receiving Route reply and the point which
message is sent to check route (Unit: ms)
Maximum number of communication error which can be allowed from when
Route repair is started.
The time until Route Discovery is expired.
Maximum of Broadcast Jitter.
The number of retry when Route Request Command is broadcasted first.
The number of retries that Route Request Command undergoes in the relay
process by coordinator/router.
The interval of Route Request Command retry (unit: ms).
Minimum jitter when resending Route Request Command (unit: 2ms Slot).
Maximum jitter when resending Route Request Command (unit: 2ms Slot).
Maximum length of NSDU defined in CEL ZigBee Stack.
Document No. 0005-05-08-08-001
Page 7 of 25
ZIC2410 Network Layer API Reference
5 NETWORK LAYER PRIMITIVES
NWK consists of Request (*.req), Confirm (*.con), and Indication (*.ind) primitives. When
receiving a request from an upper layer, the function in the Network Layer is performed by a
Request primitive. When the Request is received, a Confirm primitive returns confirmation of
that receipt to the upper requesting layer. In some cases, when the requested event has been
completed, there is an Indication primitive sent to the upper layer to inform it of the event.
Only NWK-DATA.req primitives need the transmission/reception of a frame; the other primitives
do not.
Figure 3 – Message Sequence Chart for NWK Primitives
Table 4 – List of NWK Primitives vs. API Functions
Primitive
API (Calling Function Name)
Standard NWK Primitives
NLDE-DATA (Section 5.1)
NLME-NETWORK-DISCOVERY (Section 5.2)
NLME-NETWORK-FORMATION (Section 5.3)
NLME-PERMIT-JOIN (Section 5.4)
NLME-START-ROUTER (Section 5.5)
NLME-JOIN (Section 5.6)
NLME-DIRECT-JOIN (Section 5.7)
NLME-LEAVE (Section 5.8)
NLME-RESET (Section 5.9)
NLME-SYNC (Section 5.10)
NLME-GET (Section 5.11)
NLME-SET (Section 5.13)
NLME-ROUTE-DISCOVERY (Section 5.15)
Non-Standard NWK Primitives
(defined by CEL.)
NLME-FORCE-JOIN (Section 5.17)
NLME-GET_TABLE (Section 5.12)
NLME-SET_TABLE (Section 5.14)
1
() = (NLDME_PKT *pReq, NLDME_PKT *pCon)1
void ZNWK_DATA_REQ()
void ZNWK_NETWORK_FORM_DISC_REQ()
void ZNWK_NETWORK_FORM_REQ()
void ZNWK_PERMIT_JOIN_REQ()
void ZNWK_START_ROUTE_REQ()
void ZNWK_JOIN_REQ()
void ZNWK_DIRECT_JOIN_REQ()
void ZNWK_LEAVE_REQ()
void ZNWK_RESET_REQ()
void ZNWK_SYNC_REQ()
void ZNWK_GET_REQ()
void ZNWK_SET_REQ()
void ZNWK_ROUTE_DISC_REQ()
() = (NLDME_PKT *pReq, NLDME_PKT *pCon)1
void ZNWK_FORCE_JOIN_REQ()
void ZNWK_GET_TABLE_REQ()
void ZNWK_SET_TABLE_REQ()
Each of the API of Table 4 above has two common input parameters
Rev B
Document No. 0005-05-08-08-001
Page 8 of 25
ZIC2410 Network Layer API Reference
Table 5 is a table of Structure Names and their corresponding Union Members of the
NLDME_PKT union. Each Structure Name is described in detail in the (Section) referenced in
the table.
Table 5 – NLDME_PKT typedef union
Structure Name
Union Member
DATA_REQ;
NLDE_DATA_req (Section 5.1.1)
DATA_CON;
NLDE_DATA_con (Section 5.1.2)
DATA_IND;
NLDE_DATA_ind (Section 5.1.3)
NET_DISC_REQ;
NLME_NET_DISC_req (Section 5.2.1)
NET_DISC_CON;
NLME_NET_DISC_con (Section 5.2.2)
NET_FORM_REQ;
NLME_NET_FORM_req (Section 5.3.1)
NET_FORM_CON;
NLME_NET_FORM_con (Section 5.3.2)
PERMIT_JOIN_REQ;
NLME_PERMIT_JOIN_req (Section 5.4.1)
PERMIT_JOIN_CON;
NLME_PERMIT_JOIN_con (Section 5.4.2)
START_ROU_REQ;
NLME_START_ROU_req (Section 5.5.1)
START_ROU_CON;
NLME_START_ROU_con (Section 5.5.2)
JOIN_REQ;
NLME_JOIN_req (Section 5.6.1)
JOIN_CON;
NLME_JOIN_con (Section 5.6.2)
JOIN_IND;
NLME_JOIN_ind (Section 5.6.3)
DIRECT_JOIN_REQ;
NLME_DIRECT_JOIN_req (Section 5.7.1)
DIRECT_JOIN_CON;
NLME_DIRECT_JOIN_con (Section 5.7.2)
LEAVE_REQ;
NLME_LEAVE_req (Section 5.8.1)
LEAVE_CON;
NLME_LEAVE_con (Section 5.8.2)
LEAVE_IND;
NLME_LEAVE_ind (Section 5.8.3)
RESET_REQ;
NLME_RESET_req (Section 5.9.1)
RESET_CON;
NLME_RESET_con (Section 5.9.2)
SYNC_REQ;
NLME_SYNC_req (Section 5.10.1)
SYNC_CON;
NLME_SYNC_con (Section 5.10.2)
SYNC_IND;
NLME_SYNC_ind (Section 5.10.3)
GET_REQ;
NLME_GET_req (Section 5.11.1)
GET_CON;
NLME_GET_con (Section 5.11.2)
SET_REQ;
NLME_SET_req (Section 5.13.1)
SET_CON;
NLME_SET_con (Section 5.13.2)
ROU_DISC_REQ;
NLME_ROUTE_DISC_req (Section 5.15.1)
ROU_DISC_CON;
NLME_ROUTE_DISC_con (Section 5.15.2)
ROU_ERR_IND;
NLME_ROUTE_ERR_ind (Section 5.16.1)
Non-Standard Primitives (defined by CEL)
GET_TABLE_REQ;
NLME_GET_TABLE_req (Section 5.12.1)
GET_TABLE_CON;
NLME_GET_TABLE_con (Section 5.12.2)
SET_TABLE_REQ;
NLME_SET_TABLE_req (Section 5.14.1)
SET_TABLE_CON;
NLME_SET_TABLE_con (Section 5.14.2)
FORCE_JOIN_REQ;
NLME_FORCE_JOIN_req (Section 5.17.1)
FORCE_JOIN_CON;
NLME_FORCE_JOIN_con (Section 5.17.2)
Rev B
Document No. 0005-05-08-08-001
Page 9 of 25
ZIC2410 Network Layer API Reference
5.1
NLDE-DATA
This primitive supports the transport of application protocol data units (APDUs) between peer
application entities.
Table 6 – Primitives Used in Communicating NWK Data
Calling
2
Range
Description
Field Name
Function’s
Member Name
4
5.1.1
NLDE-DATA.req
Calling Function Name: ZNWK_DATA_REQ()
This primitive requests the transfer of a data PDU (NSDU) from the local APS sub-layer entity to a single or
multiple peer APS sub-layer entities
Defines the meaning of the DstAddr field:
DstMode
UINT8
1 = Multicast GroupID.
2 = NWK Address of a device or Broadcast Address.
DstAddress
DstAddr
UINT16
The Destination Address (based on the DstMode field).
nsduLen
UINT8
The length (in octets) of the NSDU.
nsduHandle
UINT8
The handle associated with the NSDU.
Radius
UINT8
The maximum number of hops for a frame.
The number of multicast hop which a non-member device
NoMemRadius
UINT8
can relay. (Value of 0x07 = unlimitied)
TxOpt_DiscRoute UINT8
DiscRoute
Routing Discovery: See [Note] below
Note: DiscRoute parameter is used in CEL ZigBee Stack as follows.
bit [7:4]: Out-Of-Band (OOB) code.
bit [3]: The bit for test. Always to be ‘0’.
bit [2:1]: Reserved
bit [0]: 0 = Does not perform Routing Discovery. 1 = Perform Routing Discovery.
This code value is sent to MAC and it is included in the RF packet. 4’b0000 means normal IEEE 802.15.4 packet.
The OOB value range from 4’b0001 to 4’b1111 can be defined for special purposes.
Security
UINT8
1 = Use security.
UINT8
nsdu
*pnsdu
NSDU data
Array
Instead of nsdu, a pointer for nsdu (UINT8 *pnsdu) is used in the CEL ZigBee Stack
5.1.2
NLDE-DATA.con Calling Function Name: ZNWK_DATA_REQ()
This primitive reports the results of a request to transfer a data
nsduHandle
UINT8
The handle associated with the NSDU.
Status of MCPS-DATA.con.
0xC2: INVALID_REQUEST
0xCC: MAX_FRM_COUNTER
0xCD: NO_KEY
Status
Sta
UINT8
0xCE: BAD_CCM_OUTPUT
0xD1: ROUTE_ERROR
0xD2: BT_TABLE_FULL
0xD3: FRAME_NOT_BUFFERED
5.1.3
NLDE-DATA.ind Calling Function Name: ZNWK_DATA_IND()
This primitive indicates the transfer of data from the NWK layer to the local APS sub-layer entity
1 = DstAddr field means Multicast GroupID.
DstMode
UINT8
2 = DstAddr means NWK Address of a device or Broadcast
Address.
DstAddress
DstAddr
UINT16
The Destination Address (based on the DstMode field).
3
2
3
4
Member name in the ZigBee spec (applies to this entire document).
It is used when the member name in the source code is different from that in the ZigBee spec.
Function which calls the corresponding primitive in the source code (applies to this entire document).
Rev B
Document No. 0005-05-08-08-001
Page 10 of 25
ZIC2410 Network Layer API Reference
3
2
Field Name
SrcAddress
nsduLen
LQI
Calling
Function’s
Member Name
SrcAddr
Range
Description
NWK Address of Source.
The length (in octets) of the NSDU.
Link Quality Indicator of received frame.
NSDU data.
nsdu
*pnsdu
UINT8
Please refer to the [Note] below.
Note: Instead of nsdu, a pointer for nsdu (UINT8 *pnsdu) is used in CEL ZigBee Stack.
5.2
UINT16
UINT8
UINT8
NLME-NETWORK-DISCOVERY
This primitive allows the next higher layer to request that the NWK layer discover networks
currently operating within the POS.
Field Name
5.2.1
Table 7 – NLME-NETWORK-DISCOVERY Functions
Calling
Function’s
Range
Description
Member Name
NLME-NETWORKDISCOVERY.req
Calling Function Name: ZNWK_NETWORK_DISC_REQ()
Requests a network search. This function requests an Active Channel scan to the MAC layer using MLMESCAN.req
Channel Scan List: corresponding bit # in this field is set to 1
for each channel to be scanned.
bit [31:27]: Reserved
ScanChannels ScanChan
UINT32
bit [26:11]: Channel 26-11. 2.4GHz bandwidth.
bit [10:0]: Reserved
Determines the scan time for each channel
(0x00 ~ 0x0F). Time is as follows.
0 = 33ms // 1 = 49ms // 2 = 81ms // 3 = 145ms //
4 = 273ms // 5 = 529ms // 6 = 1.04sec // 7 = 2.06sec //
ScanDuration
ScanDur
UINT8
8 = 4.11sec // 9 = 8.20sec // 10 = 16.40sec //
11 = 32.78sec //12 = 13 = 14 = 15 =65.5sec //
CEL ZigBee Stack sets the scan duration to 65.5sec max
for values of 12 through 15.
5.2.2
NLME-NETWORKDISCOVERY.con
Calling Function Name: ZNWK_NETWORK _DISC_REQ()
This primitive reports the results of a network discovery operation
NwkCount
UINT8
The number of networks searched.
Status
Sta
UINT8
The Status returned by the MLME-SCAN.con primitive
Network Descriptor of the searched networks.
NetworkDescri
*pZNET
Please refer to the [Note] and Table 8 below.
ptor
Note: CEL ZigBee Stack does not use the standard NetworkDescriptor structure. Instead, a pointer for
S_ZIGBEE_NET (S_ZIGBEE_NET *pZNET) descriptor structure defined by CEL, is used.
Table 8 – NetworkDescriptor Structures CEL and ZigBee 2006 Standard
Name
Range
Description
Descriptor Structure S_ZIGBEE_NET defined by CEL
LogicalChan
UINT8
Channel of Coordinator/Router.
PanID
UINT16
Pan ID of Coordinator/Router.
Rev B
Document No. 0005-05-08-08-001
Page 11 of 25
ZIC2410 Network Layer API Reference
Name
Description
Address Mode of Coordinator/Router.
2 = Use Short Address Mode. ShortAddr field means NWK Address of
AddrMode
UINT8
coordinator/router. ExtAddr field is meaningless.
3 = Coordinator/Router use Extended Address Mode. ExtAddr field means
IEEE Address. ShortAddr field is meaningless.
AddrMode = 2:
ShortAddr
UINT16
It means NWK Address of coordinator/router.
UINT8
AddrMode = 3:
ExtAddr
Array
It means IEEE Address of coordinator/router.
SuperframeSpecification [15:8] of Beacon Frame:
SO_BO
UINT8
bit [7:4]: Superframe Order(SO)
bit [3:0]: Beacon Order(BO)
SuperframeSpecification [7:0] of Beacon Frame:
bit [7]: PermitJoining. 1 = Allow join.
bit [6]: PanCoordinator. 1 = Operate as PAN Coordinator.
SuperSpec_H
UINT8
bit [5]: Reserved.
bit [4]: BattExt. 1 = Enable Battery Extension function.
bit [3:0]: FinalCap.
GTSPermit
UINT8
1 = Allow GTS
LinkQuality
UINT8
Link Quality Indicator of received beacon frame.
Timestamp of received beacon frame.
Timestamp
UINT32
Beacon-Used on the enabled PAN.
SecurityUse
UINT8
1 = Use security.
ACLEntry
UINT8
ACL Entry
SecurityFail
UINT8
1 = Failed during using security
BeaconPayloadLen UINT8
The length of payload of received beacon frame.
Payload of received beacon frame. (maximum of 16 bytes).
BeaconPayload in ZigBee2006 consists of as follows
BYTE[0]: Protocol ID
BYTE[1]
bit [3:0]: Stack Profile
bit [[7:4]: Protocol Version. 2 = ZigBee2006
UINT8
BYTE[2]
BeaconPayload
Array
bit [1:0]: Reserved
bit [2]: Router Capacity. 1 = Router Capable
bit [6:3]: Device Depth
bit [7]: End Device Capacity. 1 = Allow join of end device
BYTE[10] ~ BYTE[3]: Extended PAN ID
BYTE[13] ~ BYTE[11]: TxOffset.
Multi-hop Beacon-field existed in Enabled PAN.
Standard NetworkDescriptor defined in ZigBee2006 but not supported by the CEL ZigBee Stack
PanID
UINT16
Network Pan ID
UINT8
Extended PAN ID
ExtendedPanID
Array
LogicalChan
UINT8
Channel of coordinator/router.
StackProfile
UINT8
Stack Profile
ZigBeeVersion
UINT8
ZigBee Protocol Version
BeaconOrder
UINT8
Beacon Order(BO)
SuperframeOrder
UINT8
Superframe Order(SO)
PermitJoining
UINT8
1 = Allow join.
Rev B
Range
Document No. 0005-05-08-08-001
Page 12 of 25
ZIC2410 Network Layer API Reference
5.3
NLME-NETWORK-FORMATION
This primitive allows the next higher layer to request that the device start a new ZigBee network
with itself as the coordinator and subsequently make changes to its superframe configuration.
The network is formatted after selecting the channel to use by starting an ED-Scan per channel
on ScanChannels. The PanID of the new network is determined by a random value.
Field Name
5.3.1
Table 9 – NLME-NETWORK-FORMATION Functions
Calling
Description
Function’s
Range
Possible Responses
Member Name
NLME-NETWORKFORMATION.req
Calling Function Name: ZNWK_ NETWORK_ FORM_REQ()
ScanChannels
ScanChan
UINT32
ScanDuration
ScanDur
UINT8
BattExtend
UINT8
UINT8
UINT8
BO
SO
BatteryExtend
5.3.2
Status
5.4
NLME-NETWORKFORMATION.con
Sta
Channel Scan List: corresponding bit # in this field is set to 1 for
each channel to be scanned.
bit [31:27]: Reserved
bit [26:11]: Channel 26-11. 2.4GHz bandwidth.
bit [10:0]: Reserved
Determines the scan time for each channel
(0x00 ~ 0x0F). Time is as follows.
0 = 33ms // 1 = 49ms // 2 = 81ms // 3 = 145ms //
4 = 273ms // 5 = 529ms // 6 = 1.04sec // 7 = 2.06sec //
8 = 4.11sec // 9 = 8.20sec // 10 = 16.40sec //
11 = 32.78sec //12 = 13 = 14 = 15 = 65.5sec //
CEL ZigBee Stack sets the scan duration to 65.5sec max for
values of 12-15.
Beacon Order of new network.
Superframe Order of new network.
No function
Calling Function Name: ZNWK_ NETWORK_FORM_REQ()
UINT8
0xC2: INVALID_REQUEST
0xC4: STARTUP_FAILURE
or any status returned by the MLME-START.con primitive
NLME-PERMIT-JOIN
This primitive allows the next higher layer of a ZigBee coordinator or router to set its MAC sublayer association permit flag for a fixed period when it may accept devices onto its networkt
Table 10 – NLME-PERMIT-JOIN Functions
Calling
Description
Field Name
Function’s
Range
Possible Responses
Member Name
5.4.1
NLME-PERMIT-JOIN.req Calling Function Name: ZNWK_PERMIT_JOIN_REQ()
Determines the time allowed for joining (in sec).
0x00: Not allow join
PermitDuration
PermitDur
UINT8
0xFF: Always allow join.
(See Figure 4)
0x01 ~ 0xFE: Allow join if time has not expired
5.4.2
NLME-PERMIT-JOIN.con Calling Function Name: ZNWK_PERMIT_JOIN_REQ()
0xC2: INVALID_REQUEST
Status
Sta
UINT8
or any status returned by the MLME-SET.con primitive
Figure 4 shows the operation of the NLME-PERMIT-JOIN.req command based on the value of the
PermitDuration time.
Rev B
Document No. 0005-05-08-08-001
Page 13 of 25
ZIC2410 Network Layer API Reference
Figure 4 – NLME-PERMIT-JOIN.req based on PermitDuration time
5.5
NLME-START-ROUTER
This primitive allows the next higher layer of a ZigBee router to initiate the activities expected of
a ZigBee router including the routing of data frames, route discovery, and the accepting of
requests to join the network from other devices.
Field Name
5.5.1
Table 11 – NLME-START-ROUTER Functions
Calling
Function’s
Range
Description
Member Name
NLME-STARTROUTER.req
BO
SO
BattExtend
UINT8
UINT8
UINT8
5.5.2
Status
Rev B
Calling Function Name: ZNWK_ START_ROUTE_REQ()
NLME-STARTROUTER.con
Sta
Beacon Order of router.
Superframe Order of router.
1 = Enable Battery Extension function
Calling Function Name: ZNWK_ START_ ROUTE_REQ()
UINT8
0xC2: INVALID_REQUEST
or any status returned by the MLME-START.con primitive
Document No. 0005-05-08-08-001
Page 14 of 25
ZIC2410 Network Layer API Reference
5.6
NLME-JOIN
A device trying to join a network, first searches for existing networks by performing NLME-NETWORKDISCOVERY.req. After finding a parent node to join, the descriptors from the NLME-NETWORKDISCOVERY.con are set as the parameters of the NLME-JOIN.req.
Table 12 – NLME-JOIN Functions
Field Name
Calling
Function’s
Member Name
Range
Description
Calling Function Name: ZNWK_JOIN_REQ()
UINT8
Extended Pan ID of the device to join.
EPID
Array
JoinAsRou
UINT8
1 = Join as router. 0 = Join as end device.
0 = Join by association
RejoinNetwork Rejoin
UINT8
1 = Direct joining or join using rejoining by MAC orphaning
2 = Join by NWK rejoining
Channel Scan List: corresponding bit # in this field is set to
1 for each channel to be scanned.
bit [31:27]: Reserved
ScanChannels ScanChan
UINT32
bit [26:11]: Channel 26~11. 2.4GHz band.
bit [10:0]: Reserved
Determines the scan time for each channel
(0x00 ~ 0x0F). Time is as follows.
0 = 33ms // 1 = 49ms // 2 = 81ms // 3 = 145ms //
4 = 273ms // 5 = 529ms // 6 = 1.04sec // 7 = 2.06sec //
ScanDuration
ScanDur
UINT8
8 = 4.11sec // 9 = 8.20sec // 10 = 16.40sec //
11 = 32.78sec //12 = 13 = 14 = 15 = 65.5sec //
CEL ZigBee Stack sets the scan duration to 65.5sec max
for values of 12-15.
PowerSource
PwrSrc
UINT8
Power 1 = Mains-Power, 0 = Other Power
In idle status, it determines the status of receiver.
RxOnWhenIdle RxOnIdle
UINT8
1 = Receiver operates in idle status.
MAC Security Enable/Disable
MACSecurity
MACSecure
UINT8
1 = MAC Security Enable.
5.6.2
NLME-JOIN.con Calling Function Name: ZNWK_JOIN_REQ()
Allows the next higher layer to be notified of the results of its request to join a network
ShortAddress
ShortAddr
UINT16
NWK Address assigned by join.
PanID
UINT16
PanID of network which is joined.
HaveNetworkK
1 = Has same NWK Key which parent node has.
NwkKey
UINT8
ey
0 = Doesn’t have same NWK Key which parent node has.
0xC2: INVALID_REQUEST
0xC3: NOT_PERMITTED
0xCA: NO_NETWORKS
0x00: Success
Status
Sta
UINT8
0x01: Failure. Cannot join because parent lacks
capacity (exceeds Max Children or Max Router)
0x02: Failure. Join is rejected by parent.
or any status returned by the MLME-ASSOCIATE.con or
MLME-SCAN.con primitives.
Calling Function Name:
5.6.3
NLME-JOIN.ind
ZNWK_JOIN_IND()  ZUSER_NWK_JOI N_IND()
Allows the next higher layer of a ZigBee coordinator or ZigBee router to be notified when a new device has
successfully joined its network by association or rejoined using the NWK rejoin procedure
ShortAddress
ShortAddr
UINT16
NWK Address which is assigned to the joined device.
5.6.1
NLME-JOIN.req
Extended
PanID
JoinAsRouter
Rev B
Document No. 0005-05-08-08-001
Page 15 of 25
ZIC2410 Network Layer API Reference
Field Name
ExtendedAddr
ess
Calling
Function’s
Member Name
ExtendAddr
CapaInfo
UINT8
Array
UINT8
SecureJoin
5.7
Range
Secure
UINT8
Description
IEEE Address of the joined device.
Capability Information of the joined device.
bit [7]: Allocate Address. 1 = Request NWK Address
assignment. Always 1.
bit [6]: Security Capability. 1 = Enable MAC Security
bit [5:4]: Reserved
bit [3]: RxOnWhenIdle. 1 = In idle status, receiver is
enabled.
bit [2]: PowerSource. 1 = Mains-Power
bit [1]: DeviceType. 1 = Operate router, 0 = Operate end
device.
bit [0]: Alternative PAN Coordinator. Always 0.
1 = Join is done as security is done.
NLME-DIRECT-JOIN
This primitive is used when coordinator/router joins other devices to its network without any
over the air transmission.
Table 13 – NLME-DIRECT-JOIN Functions
Calling
Field Name
Function’s
Range
Description
Member Name
5.7.1
NLME-DIRECT-JOIN.req Calling Function Name: ZNWK_DIRECT_JOIN_REQ()
UINT8
DeviceAddress DevAddr
IEEE Address of device to join directly.
Array
Capability Information of the joined device.
bit [7]: Allocate Address. 1 = Request NWK Address
assignment. Always 1.
bit [6]: Security Capability. 1 = Enable MAC Security.
bit [5:4]: Reserved
CapaInfo
UINT8
bit [3]: RxOnWhenIdle. 1 = In idle status, receiver is
enabled.
bit [2]: PowerSource. 1 = Main Power
bit [1]: DeviceType. 1 = Operate router, 0 = Operate end
device.
bit [0]: Alternative PAN Coordinator. Always 0.
5.7.2
NLME-DIRECT-JOIN.con Calling Function Name: ZNWK_DIRECT_JOIN_REQ()
UINT8
IEEE Address of the device to join directly.
DeviceAddress DevAddr
Array
0x00: SUCCESS
Status
Sta
UINT8
0xC5: ALREADY_PRESENT
0xC7: NEIGHBOR_TABLE_FULL
Rev B
Document No. 0005-05-08-08-001
Page 16 of 25
ZIC2410 Network Layer API Reference
5.8
NLME-LEAVE
This primitive is used to request that the source device or one of its child devices leave a network.
Table 14 – NLME-LEAVE Functions
Field Name
Calling
Function’s
Member Name
Range
Description
Calling Function Name: ZNWK_LEAVE_REQ()
UINT8
IEEE Address of the device to leave.
DeviceAddress DevAddr
Array
0: It means that a device leaves by itself.
1 = Leave the child device of leaving device.
RemoveChildr
RmChild
UINT8
0 = Does not leave the child device of the leaving device.
en
1 = Try to rejoin after the device is left.
Rejoin
UINT8
0 = Does not try to rejoin after the device is left.
1 = Assign NWK Address used by the leaving device to
ReuseAddress ReuseAddr
UINT8
other device.
Silent
UINT8
1 = To be left without RF transmission/reception.
5.8.2
NLME-LEAVE.con Calling Function Name: ZNWK_LEAVE_REQ()
UINT8
DeviceAddress DevAddr
IEEE Address of the device to leave.
Array
0x00: SUCCESS
0xC2: INVALID_REQUEST
Status
Sta
UINT8
0xC8: UNKNOWN_DEVICE
or any status returned by the MCPS-DATA.con primitive
Calling Function Name:
5.8.3
NLME-LEAVE.ind
ZNWK_LEAVE_IND()  ZUSER_NWK_ LEAVE_IND()
When the device is left or the neighboring device is left, it informs to upper layer.
UINT8
IEEE Address of the device to leave.
DeviceAddress DevAddr
Array
1 = Try to rejoin after the device is left.
Rejoin
UINT8
0 = Does not try to rejoin after the device is left.
5.8.1
NLME-LEAVE.req
Figure 5 shows the operation of NLME-LEAVE.req based on the setting of the ‘Silent’ field
Aps
Nwk
NLME-LEAVE.req
(DevAddr = IEEE,
Silent=0)
~.con
(DevAddr=IEEE,
SUCCESS or MAC
Status)
Mac
MCPS-DATA.req
(NWK leave)
Aps
Nwk
Mac
NLME-LEAVE.req
(DevAddr = IEEE,
Silent=1)
~.con
~.con
(DevAddr=IEEE,
SUCCESS)
Request Removing(ZC or ZR, Silent=0)
Request Removing(ZC or ZR, Silent=1)
Figure 5 – NLME-LEAVE.req based on Silent setting
Rev B
Document No. 0005-05-08-08-001
Page 17 of 25
ZIC2410 Network Layer API Reference
5.9
NLME-RESET
Table 15 – NLME-RESET Functions
Field Name
Calling
Function’s
Member Name
Range
Description
5.9.1
NLME-RESET.req Calling Function Name: ZNWK_RESET_REQ()
It is used when resetting NWK layer. There are no parameters for this primitive .
5.9.2
Status
NLME-RESET.con
Sta
UINT8
Any status returned by the MLME-RESET.con primitive
5.10 NLME-SYNC
This primitive is used when coordinator/router is synchronized.
Table 16 – NLME-SYNC Functions
Field Name
Calling
Function’s
Member Name
Range
Description
Calling Function Name: ZNWK_SYNC_REQ()
UINT8
1 = Synchronize to beacon frame.
5.10.2
NLME-SYNC.con Calling Function Name: ZNWK_SYNC_REQ()
0x00: SUCCESS
0xC6: SYNC_FAILURE
Status
Sta
UINT8
0xC1: INVALID_PARAMETER
or any status returned by the MLME-POLL.con primitive
Calling Function Name:
5.10.3
NLME-SYNC.ind
ZNWK_SYNC_IND() -> ZUSER_NWK_SYNC_IND()
When synchronization is failed, it informs to upper level. Parameter of primitive does not exist.
5.10.1
NLME-SYNC.req
Track
5.11 NLME-GET
This primitive is used when reading a NWK Information Base (NIB) value.
Note: In the CEL ZigBee Stack, NIB data is stored in tables (Neighbor Table, Routing Table, GroupID Table). Please
use the CEL defined primitive NLME-GET-TABLE.req instead to read NIB values. See Section 5.12.
Table 17 – NLME-GET Functions
Calling
Field Name
Function’s
Range
Description
Member Name
5.11.1
NLME-GET.req Calling Function Name: ZNWK_GET_REQ()
NIBAttribute
AttID
UINT8
Attribute to acquire.
5.11.2
NLME-GET.con Calling Function Name: ZNWK_GET_REQ()
0x00: SUCCESS
Status
Sta
UINT8
0xC9: UNSUPPORTED_ATTRIBUTE
NIBAttribute
AttID
UINT8
Attribute to acquire.
NIBAttributeLe
AttLen
UINT8
The length of NIBAttributeValue.
ngth
NIBAttributeVal
UINT8
AttValue
Attribute Value
ue
Array
Rev B
Document No. 0005-05-08-08-001
Page 18 of 25
ZIC2410 Network Layer API Reference
5.12 NLME-GET-TABLE
Note: This is a primitive defined in CEL ZigBee Stack for special use and is not defined in the ZigBee standard. It is
used when reading NIB table entries (Neighbor Table, Routing Table, GroupID Table).
Table 18 – NLME-GET-TABLE Functions
Calling
Field Name
Function’s
Range
Description
Member Name
5.12.1
NLME-GET-TABLE.req Calling Function Name: ZNWK_GET_TABLE_REQ()
NIBAttribute
AttID
UINT8
Attribute to acquire.
5.12.2
NLME-GET-TABLE.con Calling Function Name: ZNWK_GET_TABLE_REQ()
0x00: SUCCESS
Status
Sta
UINT8
0xC9: UNSUPPORTED_ATTRIBUTE
NIBAttribute
AttID
UINT8
Attribute to acquire.
EntryLength
EntryLen
UINT8
The total number of corresponding attribute.
UNIT8
A pointer for the first entry of table structure.
pEntry
*pEntry
pointer
*The structure of pEntry is changed based on NIBAttribute and, in each case, it has following structure.
Name
Range
Description
< Neighbor Table >
IEEEAddr
UINT8 Array
NwkAddr
UINT16
DevType
UINT8
RxOnWhenIdle
UINT8
Relation
UINT8
FailCnt
LQI
BeaconTime
BeaconOffset
UINT8
UINT8
UINT32
UINT32
EnaNT
UINT8
DstAddr
UINT16
RtOption
UINT8
Sta
UINT8
IEEE Address of Neighbor Device.
It is valid when relation is parent or child.
NWK Address of Neighbor Device.
Type of Neighbor Device.
0 = ZigBee Coordinator
1 = ZigBee Router
2 = ZigBee End-Device
1: When idle status, receiver is ON.
0: When idle status, receiver is OFF.
This means the relationship with Neighbor Device.
0 = parent
1 = child
2 = sibling
3 = no relation
4 = previous child
This is the number of transmission failure to Neighbor Device.
LQI of packet received finally from Neighbor Device.
optional field.(This field is NOT used.)
optional field.( This field is NOT used.))
1 = Entry is valid. (Enable)
0 = Entry is not valid.(Disable)
< Routing Table >
Rev B
Address of Routing Destination
This means Route Option.
bit [7:6]: Reserved
bit [5]: 1 = DstAddr means Group ID.
bit [4]: 1 = Entry which Route Record is supported.
bit [3]: 1 = It means Many-To-One Route.
This means the status of Route.
0x00: ACTIVE
0x01: DISCOVERY UNDERWAY
0x02: DISCOVERY FAIL
0x03: INACTIVE
0x04: VALIDATION UNDERWAY
Document No. 0005-05-08-08-001
Page 19 of 25
ZIC2410 Network Layer API Reference
Name
NextHop
Range
UINT16
EnaRT
UINT8
GroupID
UINT16
EnaGID
UINT8
Description
Address of Next Hop device of Route.
1 = Entry is valid. (Enable)
0 = Entry is not valid.(Disable)
< Group ID >
It means Group ID.
1 = Entry is valid. (Enable)
0 = Entry is not valid.(Disable)
5.13 NLME-SET
This primitive is used when setting the NWK Information Base (NIB).
Note: In the CEL ZigBee Stack, NIB data is stored in tables (Neighbor Table, Routing Table, GroupID Table). Please
use the CEL defined primitive NLME-SET-TABLE.req instead to write NIB values. See Section 5.14.
Table 19 – NLME-SET Functions
Calling
Field Name
Function’s
Range
Description
Member Name
5.13.1
NLME-SET.req Calling Function Name: ZNWK_SET_REQ()
NIBAttribute
AttID
UINT8
Attribute to set.
NIBAttributeLe
AttLen
UINT8
The length of NIBAttributeValue.
ngth
NIBAttributeVal
UINT8
AttValue
Attribute Value
ue
Array
5.13.2
NLME-SET.con Calling Function Name: ZNWK_SET_REQ()
0x00: SUCCESS
Status
Sta
UINT8
0xC1: INVALID_PARAMETER
0xC9: UNSUPPORTED_ATTRIBUTE
NIBAttribute
AttID
UINT8
Attribute to be set.
Rev B
Document No. 0005-05-08-08-001
Page 20 of 25
ZIC2410 Network Layer API Reference
5.14 NLME-SET-TABLE
Note: This is a primitive defined in CEL ZigBee Stack for special use and is not defined in ZigBee standard. It is used
when setting NIB table entries (Neighbor Table, Routing Table, GroupID Table). It is NOT recommended to set these
tables randomly (except for test purposes).
Table 20 – NLME-SET-TABLE Functions
Calling
Field Name
Function’s
Range
Description
Member Name
5.14.1
NLME-SET-TABLE.req Calling Function Name: ZNWK_SET_TABLE_REQ()
AttID
UINT8
Attribute to be set
AttLen
UINT8
The length of NIBAttributeValue
The number of entry of attribute to be set. (Total entry
number: N maximum)
UINT8
0: The number 0 of entry (first entry)
AttEntry
Array
1: The number 1 of entry (second entry)
…
N-1: The number N-1 of entry. (Nth entry)
A pointer for UNIT 8 buffer includes the contents of table
UINT8
structure to set.
pEntry
pointer
(For the entry structure based on NIB, refer to NLME-GETTABLE)
5.14.2
NLME-SET-TABLE.con Calling Function Name: ZNWK_SET_TABLE_REQ()
0x00: SUCCESS
Status
Sta
UINT8
0xC1: INVALID_PARAMETER
0xC9: UNSUPPORTED_ATTRIBUTE
AttID
UINT8
Attribute to be set
5.15 NLME-ROUTE-DISCOVERY
This primitive is used when searching Routing Path.
Field Name
5.15.1
DstAddrMode
Table 21 – NLME-ROUTE-DISCOVERY Functions
Calling
Function’s
Range
Description
Member Name
NLME-ROUTEDISCOVERY.req
DstMode
DstAddr
UINT8
5.15.2
Rev B
UINT8
UINT16
Radius
Status
Calling Function Name: ZNWK_ROUTE_DISC_REQ()
NLME-ROUTEDISCOVERY.con
Sta
It decides the meaning of DstAddr field:
0: No Destination Address
1: NWK Address of multicast group
2 :NWK Address of a device
NWK Address of Target Device which is looking for the
route.
The maximum number of hops to look for a route
Calling Function Name: ZNWK_ROUTE_DISC_REQ
UINT8
0xC2: INVALID_REQUEST
0xCF: NO_ROUTING_CAPACITY
0xD0: ROUTE_DISCOVERY_FAILED
or any status returned by the MCPS-DATA.con primitive
Document No. 0005-05-08-08-001
Page 21 of 25
ZIC2410 Network Layer API Reference
5.16 NLME-ROUTE-ERROR
Table 22 – NLME-ROUTE-ERROR Functions
Calling
Field Name
Function’s
Range
Description
Member Name
5.16.1 NLME-ROUTE-ERROR.ind Calling Function Name: ZUSER_NWK_ROUTE_ERR_IND()
It informs to upper layer when failure is caused during routing.
ShortAddr
UINT16
NWK Address of Routing Destination
Routing error code
0x00: No route available
0x01: Tree link failure
0x02: Non-tree link failure
0x03: Low battery failure
0x04: No routing capacity
0x05: No indirect capacity
Status
Sta
UINT8
0x06: Indirect transaction expired
0x07: Target device unavailable
0x08: Target address unallocated
0x09: Parent link failure
0x0A: Validate route
0x0B: Source route failure
0x0C: Many-to-one route failure
5.17 NLME-FORCE-JOIN
It is primitive defined in CEL ZigBee Stack for special use and is not defined in ZigBee
standard. This primitive is used when trying to join a parent node based on a set of defined
details for the parent.
Table 23 – NLME-FORCE-JOIN Functions
Calling
Name
Function’s
Range
Description
Member Name
5.17.1
NLME-FORCE-JOIN.req Calling Function Name: ZNWK_FORCE_JOIN_REQ()
0: Try to join by searching for a parent node defined by
NwkAddr, PanID, Channel field.
ForceMode
UINT8
1: Try to join by searching for a parent node defined by
ExtendedPanID, ScanChannel field.
NwkAddr
UINT16
Active if ForceMode = 0: NWK Address of Parent Node
PanID
UINT16
Active if ForceMode = 0: PanID of Parent Node.
ExtendedPan
UINT8
Active if ForceMode = 1:
EPID
ID
Array
Extended PanID of Parent Node.
Channel
Chan
UINT8
Active if ForceMode = 0: Channel of Parent Node
Active if ForceMode = 1:
Channel Scan List: corresponding bit # in this field is set to
1 for each channel to be scanned.
ScanChannels ScanChan
UINT32
bit [31:27]: Reserved
bit [26:11]: Channel 26-11. 2.4GHz bandwidth.
bit [10:0]: Reserved
JoinAsRouter
JoinAsRou
UINT8
1 = Join as router. 0 = Join as end device.
PowerSource
PwrSrc
UINT8
Power. 1 = Mains-Power, 0 = Other Power
In idle status, it determines the status of receiver.
RxOnWhenIdle RxOnIdle
UINT8
1 = Receiver operates in idle status.
Rev B
Document No. 0005-05-08-08-001
Page 22 of 25
ZIC2410 Network Layer API Reference
Calling
Function’s
Member Name
Name
MACSecurity
5.17.2
MACSecure
NLME-FORCE-JOIN.con
ShortAddress
PanID
HaveNetworkK
ey
ShortAddr
Status
Sta
NwkKey
Range
Description
MAC Security Enable/Disable.
1 = MAC Security Enable.
Calling Function Name: ZNWK_FORCE_JOIN_REQ()
UINT16
NWK Address assigned by join.
UINT16
PanID of network which is joined.
1 = Has same NWK Key which parent node has.
UINT8
0 = Doesn’t have same NWK Key which parent node has.
0xC2: INVALID_REQUEST
0xC3: NOT_PERMITTED
0xCA: NO_NETWORKS
or any status returned by the MLME-ASSOCIATE.con
UINT8
primitive
0x00: Success
0x01: Failure. Cannot join because parent doesn’t have
enough capability.
0x02: Failure. Join is rejected by parent.
UINT8
6 NWK Function
6.1
NETWORK BROADCASTS
NWK Broadcast Address is follows as based on the target of broadcasting.
 0xFFFF: Broadcast to all devices.
 0xFFFE: Reserved
 0xFFFD: Broadcast to devices with RxOnWhenIdle = 1 (devices where packet
reception is possible in idle status).
 0xFFFC: Broadcast to Coordinators (ZC) or Routers (ZR).
 0xFFF8 ~ 0xFFFB: Reserved
6.2
CAPACITY OF A PARENT
Each ZigBee coordinator/router can be a parent capable of joining a limited number of child
devices to its network (called its capacity). Capacity in the NIB is set as follows:
 nwkMaxRouter: Maximum number of routers allowed as child devices.
 nwkMaxChild: Maximum total number of routers and end device allowed as child
devices. (Allowable maximum number of end device is equal to the current number
of routers subtracted from nwkMaxChild).
When the capacity defined by either nwkMaxRouter or nwkMaxChild is reached a request to
join is denied by the parent device which then sends an error code (0x01: cannot allow join
because parent lacks capacity).
Rev B
Document No. 0005-05-08-08-001
Page 23 of 25
ZIC2410 Network Layer API Reference
6.3
NWK ADDRESS ASSIGNMENT
Network addresses are assigned using a distributed addressing scheme that is designed to
provide every potential parent with a finite sub-block of network addresses. These addresses
are unique within a particular network and are given by a parent to its children. The ZigBee
coordinator determines the maximum number of children any device, within its network, is
allowed. Of these children, a maximum of nwkMaxRouters can be router-capable devices.
The remaining devices shall be reserved for end devices. Every device has an associated
depth that indicates the minimum number of hops a transmitted frame must travel, using only
parent-child links, to reach the ZigBee coordinator. The ZigBee coordinator itself has a depth
of 0, while its children have a depth of 1. Multi-hop networks have a maximum depth that is
greater than 1. The ZigBee coordinator also determines the maximum depth of the network.
Given values for the maximum number of children a parent may have, nwkMaxChildren (Cm),
the maximum depth in the network, nwkMaxDepth (Lm), and the maximum number of routers a
parent may have as children, nwkMaxRouters (Rm), we may compute the function, Cskip(d),
essentially the size of the address sub-block being distributed by each parent at that depth to
its router-capable child devices for a given network depth, d, as follows:
Equation 1 – Computing Network Addresses
Example of Network Address Assignment
(Ex) Cm=4, Rm=2, Lm=3
d
Cskip(d)
0
13
1
5
2
1
3
-1 (no child)
0
Cskip(0) = 13
1
Cskip(1) = 5
2
Cskip(2) = 1
3
4
5
ZC or ZR
14
7
6
8
12
9
10
11
13
27
15
16
ZED
20
17
18
19
21
25
22
23
28
26
24
Figure 6 – Example of Network Address Assignment
Rev B
Document No. 0005-05-08-08-001
Page 24 of 25
ZIC2410 Network Layer API Reference
7 REVISION HISTORY
Revision
A
Date
3Sep08
B
13Jan09
Rev B
Description
Released
Updated Figure 1; updated descriptions in Table 1, Table 2; corrected wording
throughout
Document No. 0005-05-08-08-001
Page 25 of 25