A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
zigbee-zdo-server-header.cc
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
12
13#include "ns3/address-utils.h"
14
15namespace ns3
16{
17namespace zigbee
18{
19
25
29
30void
32{
33 m_tsn = tsn;
34}
35
36uint8_t
38{
39 return m_tsn;
40}
41
42void
44{
45 m_status = status;
46}
47
48uint8_t
50{
51 return m_status;
52}
53
54void
56{
57 m_ieeeAddrRemoteDev = ieeeAddrRemoteDev;
58}
59
65
66void
68{
69 m_nwkAddrRemoteDev = nwkAddrRemoteDev;
70}
71
77
78void
88
89void
90NwkAddrResponseCmd::Print(std::ostream& os) const
91{
92 os << "NwkAddrResponseCmd: "
93 << "TSN: " << static_cast<uint32_t>(m_tsn) << ", "
94 << "Status: " << static_cast<uint32_t>(m_status) << ", "
95 << "IEEE Address Remote Device: " << m_ieeeAddrRemoteDev << ", "
96 << "NWK Address Remote Device: " << m_nwkAddrRemoteDev;
97}
98
101{
102 return 12; // TSN (1) + Status (1) + IEEE address (8) + NWK address (2)
103}
104
107{
108 Buffer::Iterator i = start;
109
110 m_tsn = i.ReadU8();
111 m_status = i.ReadU8();
114 return i.GetDistanceFrom(start);
115}
116
117TypeId
119{
120 static TypeId tid = TypeId("ns3::zigbee::NwkAddrResponseCmd")
121 .SetParent<Header>()
122 .SetGroupName("Zigbee")
123 .AddConstructor<NwkAddrResponseCmd>();
124 return tid;
125}
126
127TypeId
129{
130 return GetTypeId();
131}
132
133} // namespace zigbee
134} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:109
void WriteU8(uint8_t data)
Definition buffer.h:944
uint32_t GetDistanceFrom(const Iterator &o) const
Definition buffer.cc:767
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
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1003
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.