A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::zigbee::NwkAddrRequestCmd Class Reference

Implements the NWK_addr_req command See Zigbee Specification r22.1.0, Section 2.4.3.1.1. More...

#include "zigbee-zdo-client-header.h"

Inheritance diagram for ns3::zigbee::NwkAddrRequestCmd:
Collaboration diagram for ns3::zigbee::NwkAddrRequestCmd:

Public Member Functions

 NwkAddrRequestCmd ()
 ~NwkAddrRequestCmd () override
uint32_t Deserialize (Buffer::Iterator start) override
Mac64Address GetIeeeAddress ()
 Get the IEEE address set for the network address request.
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
uint8_t GetRequestType () const
 Get the request type previously set for the network address request.
uint32_t GetSerializedSize () const override
uint8_t GetStartIndex () const
 Get the start index.
uint8_t GetTsn () const
 Get the transaction sequence number.
void Print (std::ostream &os) const override
void Serialize (Buffer::Iterator start) const override
void SetIeeeAddress (Mac64Address ieeeAddress)
 Set the IEEE address used as base for the network address request.
void SetRequestType (uint8_t type)
 Set the request type, either single device or extended response.
void SetStartIndex (uint8_t index)
 Set the start index.
void SetTsn (uint8_t tsn)
 Set the transaction sequence number.
Public Member Functions inherited from ns3::Header
 ~Header () override
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator.
Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::Header
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::Chunk
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.

Private Attributes

Mac64Address m_ieeeAddress
 The IEEE address of the device to be queried.
uint8_t m_requestType {0}
 Single device or extended response type.
uint8_t m_startIndex {0}
 The starting index for the response, used for pagination.
uint8_t m_tsn {0}
 The transaction sequence number for the request.

Additional Inherited Members

Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.

Detailed Description

Implements the NWK_addr_req command See Zigbee Specification r22.1.0, Section 2.4.3.1.1.

Definition at line 64 of file zigbee-zdo-client-header.h.

Constructor & Destructor Documentation

◆ NwkAddrRequestCmd()

ns3::zigbee::NwkAddrRequestCmd::NwkAddrRequestCmd ( )

Definition at line 20 of file zigbee-zdo-client-header.cc.

References m_requestType, m_startIndex, and m_tsn.

Referenced by GetTypeId().

Here is the caller graph for this function:

◆ ~NwkAddrRequestCmd()

ns3::zigbee::NwkAddrRequestCmd::~NwkAddrRequestCmd ( )
override

Definition at line 27 of file zigbee-zdo-client-header.cc.

Member Function Documentation

◆ Deserialize()

uint32_t ns3::zigbee::NwkAddrRequestCmd::Deserialize ( Buffer::Iterator start)
overridevirtual
Parameters
startan iterator which points to where the header should read from.
Returns
the number of bytes read.

This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.

Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.

Implements ns3::Header.

Definition at line 107 of file zigbee-zdo-client-header.cc.

References ns3::Buffer::Iterator::GetDistanceFrom(), m_ieeeAddress, m_requestType, m_startIndex, m_tsn, ns3::ReadFrom(), and ns3::Buffer::Iterator::ReadU8().

Here is the call graph for this function:

◆ GetIeeeAddress()

Mac64Address ns3::zigbee::NwkAddrRequestCmd::GetIeeeAddress ( )

Get the IEEE address set for the network address request.

Returns
The IEEE address.

Definition at line 50 of file zigbee-zdo-client-header.cc.

References m_ieeeAddress.

Referenced by ns3::zigbee::ZigbeeZdo::HandleNwkAddrRequest().

Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::zigbee::NwkAddrRequestCmd::GetInstanceTypeId ( ) const
overridevirtual

Get the most derived TypeId for this Object.

This method is provided by ns3::Object::GetInstanceTypeId but classes which derive from ns3::ObjectBase directly have to implement it themselves. Typically, this method should simply return the output of GetTypeId().

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 129 of file zigbee-zdo-client-header.cc.

References GetTypeId().

Here is the call graph for this function:

◆ GetRequestType()

uint8_t ns3::zigbee::NwkAddrRequestCmd::GetRequestType ( ) const

Get the request type previously set for the network address request.

Returns
The request type.

Definition at line 62 of file zigbee-zdo-client-header.cc.

References m_requestType.

Referenced by ns3::zigbee::ZigbeeZdo::HandleNwkAddrRequest().

Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::zigbee::NwkAddrRequestCmd::GetSerializedSize ( ) const
overridevirtual
Returns
the expected size of the header.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.

Implements ns3::Header.

Definition at line 101 of file zigbee-zdo-client-header.cc.

◆ GetStartIndex()

uint8_t ns3::zigbee::NwkAddrRequestCmd::GetStartIndex ( ) const

Get the start index.

Returns
The start index.

Definition at line 74 of file zigbee-zdo-client-header.cc.

References m_startIndex.

◆ GetTsn()

uint8_t ns3::zigbee::NwkAddrRequestCmd::GetTsn ( ) const

Get the transaction sequence number.

Returns
The transaction sequence number.

Definition at line 38 of file zigbee-zdo-client-header.cc.

References m_tsn.

Referenced by ns3::zigbee::ZigbeeZdo::HandleNwkAddrRequest().

Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::zigbee::NwkAddrRequestCmd::GetTypeId ( )
static

Get the type ID.

Returns
The object TypeId.

Definition at line 119 of file zigbee-zdo-client-header.cc.

References NwkAddrRequestCmd(), and ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Print()

void ns3::zigbee::NwkAddrRequestCmd::Print ( std::ostream & os) const
overridevirtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5

Implements ns3::Header.

Definition at line 91 of file zigbee-zdo-client-header.cc.

References m_ieeeAddress, m_requestType, m_startIndex, and m_tsn.

◆ Serialize()

void ns3::zigbee::NwkAddrRequestCmd::Serialize ( Buffer::Iterator start) const
overridevirtual
Parameters
startan iterator which points to where the header should be written.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.

Implements ns3::Header.

Definition at line 80 of file zigbee-zdo-client-header.cc.

References m_ieeeAddress, m_requestType, m_startIndex, m_tsn, ns3::WriteTo(), and ns3::Buffer::Iterator::WriteU8().

Here is the call graph for this function:

◆ SetIeeeAddress()

void ns3::zigbee::NwkAddrRequestCmd::SetIeeeAddress ( Mac64Address ieeeAddress)

Set the IEEE address used as base for the network address request.

Parameters
ieeeAddressThe IEEE address.

Definition at line 44 of file zigbee-zdo-client-header.cc.

References m_ieeeAddress.

Referenced by ns3::zigbee::ZigbeeZdo::NwkAddrRequest().

Here is the caller graph for this function:

◆ SetRequestType()

void ns3::zigbee::NwkAddrRequestCmd::SetRequestType ( uint8_t type)

Set the request type, either single device or extended response.

Note:Extended response is not currently supported.

Parameters
typeThe request type.

Definition at line 56 of file zigbee-zdo-client-header.cc.

References m_requestType.

Referenced by ns3::zigbee::ZigbeeZdo::NwkAddrRequest().

Here is the caller graph for this function:

◆ SetStartIndex()

void ns3::zigbee::NwkAddrRequestCmd::SetStartIndex ( uint8_t index)

Set the start index.

Used only for the pagination of extended responses. Note: Extended response is not currently supported. Therefore this is only a placeholder for future use.

Parameters
indexThe start index.

Definition at line 68 of file zigbee-zdo-client-header.cc.

References m_startIndex.

Referenced by ns3::zigbee::ZigbeeZdo::NwkAddrRequest().

Here is the caller graph for this function:

◆ SetTsn()

void ns3::zigbee::NwkAddrRequestCmd::SetTsn ( uint8_t tsn)

Set the transaction sequence number.

Parameters
tsnThe transaction sequence number.

Definition at line 32 of file zigbee-zdo-client-header.cc.

References m_tsn.

Referenced by ns3::zigbee::ZigbeeZdo::NwkAddrRequest().

Here is the caller graph for this function:

Member Data Documentation

◆ m_ieeeAddress

Mac64Address ns3::zigbee::NwkAddrRequestCmd::m_ieeeAddress
private

The IEEE address of the device to be queried.

Definition at line 144 of file zigbee-zdo-client-header.h.

Referenced by Deserialize(), GetIeeeAddress(), Print(), Serialize(), and SetIeeeAddress().

◆ m_requestType

uint8_t ns3::zigbee::NwkAddrRequestCmd::m_requestType {0}
private

Single device or extended response type.

Definition at line 145 of file zigbee-zdo-client-header.h.

Referenced by NwkAddrRequestCmd(), Deserialize(), GetRequestType(), Print(), Serialize(), and SetRequestType().

◆ m_startIndex

uint8_t ns3::zigbee::NwkAddrRequestCmd::m_startIndex {0}
private

The starting index for the response, used for pagination.

Definition at line 146 of file zigbee-zdo-client-header.h.

Referenced by NwkAddrRequestCmd(), Deserialize(), GetStartIndex(), Print(), Serialize(), and SetStartIndex().

◆ m_tsn

uint8_t ns3::zigbee::NwkAddrRequestCmd::m_tsn {0}
private

The transaction sequence number for the request.

Definition at line 143 of file zigbee-zdo-client-header.h.

Referenced by NwkAddrRequestCmd(), Deserialize(), GetTsn(), Print(), Serialize(), and SetTsn().


The documentation for this class was generated from the following files: