A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
zigbee-zdo-server-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_SERVER_HEADER_H
12#define ZIGBEE_ZDO_SERVER_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) Server Services Commands
27 * Zigbee Specification r22.1.0, Section 2.4.4.2, Table 2-91
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 client on the destination device.
33 */
34enum ZdpClustersServerCmds : std::uint16_t
35{
36 NWK_ADDR_RSP = 0x8000, //!< Network Address Response command (Mandatory)
37 IEEE_ADDR_RSP = 0x8001, //!< IEEE Address Response command (Mandatory)
38 NODE_DESC_RSP = 0x8002, //!< Node Descriptor Response command (Mandatory)
39 POWER_DESC_RSP = 0x8003, //!< Power Descriptor Response command (Mandatory)
40 SIMPLE_DESC_RSP = 0x8004, //!< Simple Descriptor Response command (Mandatory)
41 ACTIVE_EP_RSP = 0x8005, //!< Active Endpoint Response command (Mandatory)
42 MATCH_DESC_RSP = 0x8006, //!< Match Descriptor Response command (Mandatory)
43 COMPLEX_DESC_RSP = 0x8010, //!< Complex Descriptor Response command (Optional)
44 USER_DESC_RSP = 0x8011, //!< User Descriptor Response command (Optional)
45 USER_DESC_CONF = 0x8014, //!< Discovery Cache Response command (Optional)
46 PARENT_ANNCE_RSP = 0x801F, //!< Parent Announcement Response command (Mandatory)
47 SYSTEM_SERVER_DISCOVERY_RSP = 0x8015, //!< System Server Discovery Response command (Optional)
48 DISCOVERY_STORE_RSP = 0x8016, //!< Discovery Store Response command (Optional)
49 NODE_DESC_STORE_RSP = 0x8017, //!< Node Descriptor Store Response command (Optional)
50 POWER_DESC_STORE_RSP = 0x8018, //!< Power Descriptor Store Response command (Optional)
51 ACTIVE_EP_STORE_RSP = 0x8019, //!< Active Endpoint Store Response command (Optional)
52 SIMPLE_DESC_STORE_RSP = 0x801A, //!< Simple Descriptor Store Response command (Optional)
53 REMOVE_NODE_CACHE_RSP = 0x801B, //!< Remove Node Cache Response command (Optional)
54 FIND_NODE_CACHE_RSP = 0x801C, //!< Find Node Cache Response command (Optional)
55 EXTENDED_SIMPLE_DESC_RSP = 0x801D, //!< Extended Simple Descriptor Response command (Optional)
56 EXTENDED_ACTIVE_EP_RSP = 0x801E //!< Extended Active Endpoint Response command (Optional)
57};
58
59/**
60 * NWK_addr_rsp Command Frame
61 * See Zigbee Specification Section 2.4.4.2.1, Figure 2-64
62 */
64{
65 public:
67 ~NwkAddrResponseCmd() override;
68
69 /**
70 * Get the type ID.
71 *
72 * @return the object TypeId
73 */
74 static TypeId GetTypeId();
75 TypeId GetInstanceTypeId() const override;
76
77 /**
78 * Set the transaction sequence number of the NWK_addr_rsp command.
79 * This value must match the one used in the corresponding NWK_addr_req.
80 *
81 * @param tsn The transaction sequence number to set.
82 */
83 void SetTsn(uint8_t tsn);
84
85 /**
86 * Get the transaction sequence number of the NWK_addr_rsp command.
87 *
88 * @return The transaction sequence number.
89 */
90 uint8_t GetTsn() const;
91
92 /**
93 * Set the status of the NWK_addr_rsp command.
94 *
95 * @param status The status value to set.
96 */
97 void SetStatus(uint8_t status);
98
99 /**
100 * Get the status of the NWK_addr_rsp command.
101 *
102 * @return The status value.
103 */
104 uint8_t GetStatus() const;
105
106 /**
107 * Set the IEEE address of the remote device.
108 *
109 * @param ieeeAddrRemoteDev The IEEE address of the remote device.
110 */
111 void SetIeeeAddrRemoteDev(Mac64Address ieeeAddrRemoteDev);
112
113 /**
114 * Get the IEEE address of the remote device.
115 *
116 * @return The IEEE address of the remote device.
117 */
119
120 /**
121 * Set the network address of the remote device.
122 *
123 * @param nwkAddrRemoteDev The network address of the remote device.
124 */
125 void SetNwkAddrRemoteDev(Mac16Address nwkAddrRemoteDev);
126
127 /**
128 * Get the network address of the remote device.
129 *
130 * @return The network address of the remote device.
131 */
133
134 void Print(std::ostream& os) const override;
135 uint32_t GetSerializedSize() const override;
136 void Serialize(Buffer::Iterator start) const override;
137 uint32_t Deserialize(Buffer::Iterator start) override;
138
139 private:
140 uint8_t m_tsn{0}; //!< The transaction sequence number of the NWK_addr_rsp command.
141 uint8_t m_status{0}; //!< The status of the NWK_addr_rsp command.
142 Mac64Address m_ieeeAddrRemoteDev; //!< The IEEE address of the remote device.
143 Mac16Address m_nwkAddrRemoteDev; //!< The network address of the remote device.
144 // TODO fields for the optional extended response such as the number of associated devices
145 // and the list of associated devices need to be added here when the extended response is
146 // implemented.
147};
148
149} // namespace zigbee
150} // namespace ns3
151
152#endif /* ZIGBEE_ZDO_SERVER_HEADER_H */
iterator in a Buffer instance
Definition buffer.h:109
Protocol header serialization and deserialization.
Definition header.h:36
This class can contain 16 bit addresses.
an EUI-64 address
a unique identifier for an interface.
Definition type-id.h:50
uint32_t GetSerializedSize() const override
Mac16Address GetNwkAddrRemoteDev()
Get the network address of the remote device.
void SetTsn(uint8_t tsn)
Set the transaction sequence number of the NWK_addr_rsp command.
void Serialize(Buffer::Iterator start) const override
uint8_t m_status
The status of the NWK_addr_rsp command.
uint8_t m_tsn
The transaction sequence number of the NWK_addr_rsp command.
uint32_t Deserialize(Buffer::Iterator start) override
Mac16Address m_nwkAddrRemoteDev
The network address of the remote device.
Mac64Address m_ieeeAddrRemoteDev
The IEEE address of the remote device.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetIeeeAddrRemoteDev(Mac64Address ieeeAddrRemoteDev)
Set the IEEE address of the remote device.
void Print(std::ostream &os) const override
void SetStatus(uint8_t status)
Set the status of the NWK_addr_rsp command.
static TypeId GetTypeId()
Get the type ID.
Mac64Address GetIeeeAddrRemoteDev()
Get the IEEE address of the remote device.
void SetNwkAddrRemoteDev(Mac16Address nwkAddrRemoteDev)
Set the network address of the remote device.
uint8_t GetTsn() const
Get the transaction sequence number of the NWK_addr_rsp command.
uint8_t GetStatus() const
Get the status of the NWK_addr_rsp command.
ZdpClustersServerCmds
Zigbee Device Profile (ZDP) Server Services Commands Zigbee Specification r22.1.0,...
@ ACTIVE_EP_STORE_RSP
Active Endpoint Store Response command (Optional).
@ SIMPLE_DESC_STORE_RSP
Simple Descriptor Store Response command (Optional).
@ EXTENDED_ACTIVE_EP_RSP
Extended Active Endpoint Response command (Optional).
@ NODE_DESC_RSP
Node Descriptor Response command (Mandatory).
@ IEEE_ADDR_RSP
IEEE Address Response command (Mandatory).
@ SIMPLE_DESC_RSP
Simple Descriptor Response command (Mandatory).
@ COMPLEX_DESC_RSP
Complex Descriptor Response command (Optional).
@ POWER_DESC_STORE_RSP
Power Descriptor Store Response command (Optional).
@ USER_DESC_CONF
Discovery Cache Response command (Optional).
@ FIND_NODE_CACHE_RSP
Find Node Cache Response command (Optional).
@ NODE_DESC_STORE_RSP
Node Descriptor Store Response command (Optional).
@ PARENT_ANNCE_RSP
Parent Announcement Response command (Mandatory).
@ DISCOVERY_STORE_RSP
Discovery Store Response command (Optional).
@ MATCH_DESC_RSP
Match Descriptor Response command (Mandatory).
@ USER_DESC_RSP
User Descriptor Response command (Optional).
@ NWK_ADDR_RSP
Network Address Response command (Mandatory).
@ ACTIVE_EP_RSP
Active Endpoint Response command (Mandatory).
@ REMOVE_NODE_CACHE_RSP
Remove Node Cache Response command (Optional).
@ SYSTEM_SERVER_DISCOVERY_RSP
System Server Discovery Response command (Optional).
@ EXTENDED_SIMPLE_DESC_RSP
Extended Simple Descriptor Response command (Optional).
@ POWER_DESC_RSP
Power Descriptor Response command (Mandatory).
Every class exported by the ns3 library is enclosed in the ns3 namespace.