Address discovery functions
The ZDP Address Discovery functions are concerned with obtaining addresses of nodes in the network.
The functions are listed below:
Note: Further addressing functions are provided in the ZDO API and are described in Section 7.1.3.
ZPS_eAplZdpNwkAddrRequest
ZPS\_teStatus ZPS\_eAplZdpNwkAddrRequest\(
PDUM\_thAPduInstance hAPduInst,
ZPS\_tuAddress uDstAddr,
bool bExtAddr,
uint8 *pu8SeqNumber,
ZPS\_tsAplZdpNwkAddrReq *psZdpNwkAddrReq);
Description
This function requests the 16-bit network address of the node with a particular 64-bit IEEE (MAC) address. The function sends out an NWK_addr_req request, which can be either unicast or broadcast, as follows:
Unicast to another node, specified through uDstAddr, that will ‘know’ the required network address (this may be the parent of the node of interest or the Coordinator)
Broadcast to the network, in which case uDstAddrmust be set to the special network address 0xFFFF (see Section 9.3)
The IEEE address of the node of interest must be specified in the request, represented by the structure below (detailed further in Section 9.2.2.1).
typedef struct {
uint64 u64IeeeAddr;
uint8 u8RequestType;
uint8 u8StartIndex;
} ZPS_tsAplZdpNwkAddrReq;
The required network address is received in an NWK_addr_resp response, which should be collected using the function ZQ_bZQueueReceive() and stored in a structure of type ZPS_tsAplZdpNwkAddrRsp
(detailed in Section 9.2.3.1). Note that this response can optionally contain the network addresses of the responding node’s neighbors (this option is selected as part of the request through u8RequestType
).
Parent topic:ZPS_eAplZdpNwkAddrRequest
Parameters
hAPduInst: Handle of APDU instance in which request is sent
uDstAddr: Address of destination node of request (can be 16- or 64-bit, as specified by bExtAddr)
bExtAddr: Type of destination address:
TRUE: 64-bit IEEE (MAC) address
FALSE: 16-bit network address
*pu8SeqNumber: Pointer to sequence number of request
*psZdpNwkAddrReq: Pointer to request (see above).
Parent topic:ZPS_eAplZdpNwkAddrRequest
Returns
ZPS_E_SUCCESS (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:ZPS_eAplZdpNwkAddrRequest
Parent topic:Address discovery functions
ZPS_eAplZdpIEEEAddrRequest
ZPS\_teStatus ZPS\_eAplZdpIeeeAddrRequest\(
PDUM\_thAPduInstance hAPduInst,
ZPS\_tuAddress uDstAddr,
bool bExtAddr,
uint8 *pu8SeqNumber,
ZPS\_tsAplZdpIeeeAddrReq *psZdpIeeeAddrReq);
Description
This function requests the 64-bit IEEE (MAC) address of the node with a particular 16-bit network address. The function sends an IEEE_addr_req request to the relevant node, specified through uDstAddr.
The network address of the node of interest must also be specified in the request, represented by the structure below (detailed further in Section 9.2.2.2).
typedef struct {
uint16 u16NwkAddrOfInterest; uint8 u8RequestType;
uint8 u8StartIndex;
} ZPS_tsAplZdpIeeeAddrReq;
The required IEEE address is received in an IEEE_addr_resp response, which should be collected using the function ZQ_bZQueueReceive() and stored in a structure of type ZPS_tsAplZdpIeeeAddrRsp
(detailed in Section 9.2.3.2). Note that this response can optionally contain the IEEE addresses of the responding node’s neighbors (this option is selected as part of the request through u8RequestType
).
Parent topic:ZPS_eAplZdpIEEEAddrRequest
Parameters
hAPduInst Handle of APDU instance in which request is sent
uDstAddr Network address of destination node of request (bExtAddrmust be set to FALSE - see below)
bExtAddr Type of destination address: TRUE: 64-bit IEEE (MAC) address FALSE: 16-bit network address
* pu8SeqNumber Pointer to sequence number of request
* psZdpIeeeAddrReq Pointer to request (see above)
Parent topic:ZPS_eAplZdpIEEEAddrRequest
Returns
ZPS_E_SUCCESS (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:ZPS_eAplZdpIEEEAddrRequest
Parent topic:Address discovery functions
ZPS_eAplZdpDeviceAnnceRequest
ZPS_teStatus ZPS_eAplZdpDeviceAnnceRequest(
PDUM_thAPduInstance hAPduInst,
uint8 *pu8SeqNumber,
ZPS_tsAplZdpDeviceAnnceReq *psZdpDeviceAnnceReq);
Description
This function is used to notify other nodes that the local node has joined or rejoined the network. The function broadcasts a Device_annce announcement to the network and is normally automatically called by the ZDO when the local node joins or rejoins the network.
The IEEE (MAC) and allocated network addresses as well as the capabilities of the sending node must be specified in the announcement, represented by the structure below (detailed further in Section 9.2.2.3).
typedef struct {
uint16 u16NwkAddr;
uint64 u64IeeeAddr;
uint8 u8Capability;
} ZPS_tsAplZdpDeviceAnnceReq;
On receiving this announcement, a network node updates any information it holds that relates to the supplied IEEE and network addresses:
If it already holds the supplied IEEE address, it updates the corresponding network address with the supplied one (if necessary).
If it already holds the supplied network address but with a different corresponding IEEE address, the latter is marked as not having a valid corresponding network address.
Parent topic:ZPS_eAplZdpDeviceAnnceRequest
Parameters
hAPduInst Handle of APDU instance in which request is sent
* pu8SeqNumber Pointer to sequence number of announcement
* psZdpDeviceAnnceReq Pointer to announcement (see above)
Parent topic:ZPS_eAplZdpDeviceAnnceRequest
Returns
ZPS_E_SUCCESS (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:ZPS_eAplZdpDeviceAnnceRequest
Parent topic:Address discovery functions
Parent topic:ZDP API functions