A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
zigbee-zdo-client-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Tokushima University, Japan
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors:
7 *
8 * Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
9 */
10
11#ifndef ZIGBEE_ZDO_CLIENT_HEADER_H
12#define ZIGBEE_ZDO_CLIENT_HEADER_H
13
14#include "ns3/header.h"
15#include "ns3/mac16-address.h"
16#include "ns3/mac64-address.h"
17
18namespace ns3
19{
20namespace zigbee
21{
22
23/**
24 * @ingroup zigbee
25 *
26 * Zigbee Device Profile (ZDP) Client Services Commands
27 * Zigbee Specification r22.1.0, Section 2.4.3.1, Table 2-44
28 *
29 * The numbers used by this profile represent the matching Cluster ID used when sending
30 * data meant for the ZDO using the APS layer.
31 * The ZDP command frame is sent in the payload of an APS frame with the Profile ID (0x0000) and
32 * the ZDP command frame is sent to the ZDP server on the destination device.
33 */
34enum ZdpClustersClientCmds : std::uint16_t
35{
36 NWK_ADDR_REQ = 0x0000, //!< Network Address Request command (Optional)
37 IEEE_ADDR_REQ = 0x0001, //!< IEEE Address Request command (Optional)
38 NODE_DESC_REQ = 0x0002, //!< Node Descriptor Request command (Mandatory)
39 POWER_DESC_REQ = 0x0003, //!< Power Descriptor Request command (Optional)
40 SIMPLE_DESC_REQ = 0x0004, //!< Simple Descriptor Request command (Optional)
41 ACTIVE_EP_REQ = 0x0005, //!< Active Endpoint Request command (Optional)
42 MATCH_DESC_REQ = 0x0006, //!< Match Descriptor Request command (Optional)
43 COMPLEX_DESC_REQ = 0x0010, //!< Complex Descriptor Request command (Optional)
44 USER_DESC_REQ = 0x0011, //!< User Descriptor Request command (Optional)
45 DISCOVERY_CACHE_REQ = 0x0012, //!< Discovery Cache Request command (Optional)
46 DEVICE_ANNCE = 0x0013, //!< Device Announcement command (Optional)
47 PARENT_ANNCE = 0x0014, //!< Parent Announcement command (Mandatory)
48 SYSTEM_SERVER_DISCOVERY_REQ = 0x0015, //!< System Server Discovery Request command (Optional)
49 DISCOVERY_STORE_REQ = 0x0016, //!< Discovery Store Request command (Optional)
50 NODE_DESC_STORE_REQ = 0x0017, //!< Node Descriptor Store Request command (Optional)
51 POWER_DESC_STORE_REQ = 0x0018, //!< Power Descriptor Store Request command (Optional)
52 ACTIVE_EP_STORE_REQ = 0x0019, //!< Active Endpoint Store Request command (Optional)
53 SIMPLE_DESC_STORE_REQ = 0x001A, //!< Simple Descriptor Store Request command (Optional)
54 REMOVE_NODE_CACHE_REQ = 0x001B, //!< Remove Node Cache Request command (Optional)
55 FIND_NODE_CACHE_REQ = 0x001C, //!< Find Node Cache Request command (Optional)
56 EXTENDED_SIMPLE_DESC_REQ = 0x001D, //!< Extended Simple Descriptor Request command (Optional)
57 EXTENDED_ACTIVE_EP_REQ = 0x001E //!< Extended Active Endpoint Request command (Optional)
58};
59
60/**
61 * Implements the NWK_addr_req command
62 * See Zigbee Specification r22.1.0, Section 2.4.3.1.1
63 */
65{
66 public:
68 ~NwkAddrRequestCmd() override;
69
70 /**
71 * Get the type ID.
72 *
73 * @return The object TypeId.
74 */
75 static TypeId GetTypeId();
76 TypeId GetInstanceTypeId() const override;
77
78 /**
79 * Set the transaction sequence number.
80 *
81 * @param tsn The transaction sequence number.
82 */
83 void SetTsn(uint8_t tsn);
84
85 /**
86 * Get the transaction sequence number.
87 *
88 * @return The transaction sequence number.
89 */
90 uint8_t GetTsn() const;
91
92 /**
93 * Set the IEEE address used as base for the network address request.
94 *
95 * @param ieeeAddress The IEEE address.
96 */
97 void SetIeeeAddress(Mac64Address ieeeAddress);
98
99 /**
100 * Get the IEEE address set for the network address request.
101 *
102 * @return The IEEE address.
103 */
105
106 /**
107 * Set the request type, either single device or extended response.
108 * Note:Extended response is not currently supported.
109 *
110 * @param type The request type.
111 */
112 void SetRequestType(uint8_t type);
113
114 /**
115 * Get the request type previously set for the network address request.
116 *
117 * @return The request type.
118 */
119 uint8_t GetRequestType() const;
120
121 /**
122 * Set the start index. Used only for the pagination of extended responses.
123 * Note: Extended response is not currently supported. Therefore this is only
124 * a placeholder for future use.
125 *
126 * @param index The start index.
127 */
128 void SetStartIndex(uint8_t index);
129
130 /**
131 * Get the start index.
132 *
133 * @return The start index.
134 */
135 uint8_t GetStartIndex() const;
136
137 void Print(std::ostream& os) const override;
138 uint32_t GetSerializedSize() const override;
139 void Serialize(Buffer::Iterator start) const override;
140 uint32_t Deserialize(Buffer::Iterator start) override;
141
142 private:
143 uint8_t m_tsn{0}; //!< The transaction sequence number for the request.
144 Mac64Address m_ieeeAddress; //!< The IEEE address of the device to be queried.
145 uint8_t m_requestType{0}; //!< Single device or extended response type
146 uint8_t m_startIndex{0}; //!< The starting index for the response, used for pagination.
147};
148
149} // namespace zigbee
150} // namespace ns3
151
152#endif /* ZIGBEE_ZDO_CLIENT_HEADER_H */
iterator in a Buffer instance
Definition buffer.h:109
Protocol header serialization and deserialization.
Definition header.h:36
an EUI-64 address
a unique identifier for an interface.
Definition type-id.h:50
uint8_t m_requestType
Single device or extended response type.
static TypeId GetTypeId()
Get the type ID.
void Serialize(Buffer::Iterator start) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Print(std::ostream &os) const override
void SetRequestType(uint8_t type)
Set the request type, either single device or extended response.
void SetTsn(uint8_t tsn)
Set the transaction sequence number.
Mac64Address m_ieeeAddress
The IEEE address of the device to be queried.
uint8_t m_startIndex
The starting index for the response, used for pagination.
uint8_t m_tsn
The transaction sequence number for the request.
uint8_t GetTsn() const
Get the transaction sequence number.
uint8_t GetStartIndex() const
Get the start index.
uint8_t GetRequestType() const
Get the request type previously set for the network address request.
void SetIeeeAddress(Mac64Address ieeeAddress)
Set the IEEE address used as base for the network address request.
uint32_t Deserialize(Buffer::Iterator start) override
uint32_t GetSerializedSize() const override
void SetStartIndex(uint8_t index)
Set the start index.
Mac64Address GetIeeeAddress()
Get the IEEE address set for the network address request.
ZdpClustersClientCmds
Zigbee Device Profile (ZDP) Client Services Commands Zigbee Specification r22.1.0,...
@ SIMPLE_DESC_STORE_REQ
Simple Descriptor Store Request command (Optional).
@ DISCOVERY_CACHE_REQ
Discovery Cache Request command (Optional).
@ NODE_DESC_REQ
Node Descriptor Request command (Mandatory).
@ COMPLEX_DESC_REQ
Complex Descriptor Request command (Optional).
@ EXTENDED_SIMPLE_DESC_REQ
Extended Simple Descriptor Request command (Optional).
@ MATCH_DESC_REQ
Match Descriptor Request command (Optional).
@ ACTIVE_EP_REQ
Active Endpoint Request command (Optional).
@ DEVICE_ANNCE
Device Announcement command (Optional).
@ ACTIVE_EP_STORE_REQ
Active Endpoint Store Request command (Optional).
@ NWK_ADDR_REQ
Network Address Request command (Optional).
@ FIND_NODE_CACHE_REQ
Find Node Cache Request command (Optional).
@ SIMPLE_DESC_REQ
Simple Descriptor Request command (Optional).
@ POWER_DESC_REQ
Power Descriptor Request command (Optional).
@ SYSTEM_SERVER_DISCOVERY_REQ
System Server Discovery Request command (Optional).
@ IEEE_ADDR_REQ
IEEE Address Request command (Optional).
@ PARENT_ANNCE
Parent Announcement command (Mandatory).
@ REMOVE_NODE_CACHE_REQ
Remove Node Cache Request command (Optional).
@ EXTENDED_ACTIVE_EP_REQ
Extended Active Endpoint Request command (Optional).
@ USER_DESC_REQ
User Descriptor Request command (Optional).
@ POWER_DESC_STORE_REQ
Power Descriptor Store Request command (Optional).
@ DISCOVERY_STORE_REQ
Discovery Store Request command (Optional).
@ NODE_DESC_STORE_REQ
Node Descriptor Store Request command (Optional).
Every class exported by the ns3 library is enclosed in the ns3 namespace.