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

Defines the APS header use by data transfer and commands issued from the APS layer. More...

#include "zigbee-aps-header.h"

+ Inheritance diagram for ns3::zigbee::ZigbeeApsHeader:
+ Collaboration diagram for ns3::zigbee::ZigbeeApsHeader:

Public Member Functions

 ZigbeeApsHeader ()
 
 ~ZigbeeApsHeader () override
 
uint32_t Deserialize (Buffer::Iterator start) override
 
uint8_t GetApsCounter () const
 Get the APS counter value present in the APS header.
 
uint16_t GetClusterId () const
 Get the cluster id in the APS header.
 
ApsDeliveryMode GetDeliveryMode () const
 Get the transmission mode set on the header.
 
uint8_t GetDstEndpoint () const
 Get the destination endpoint in the APS header.
 
uint8_t GetFrameControl () const
 Get the frame control portion (bitmap) of the APS header.
 
ApsFrameType GetFrameType () const
 Get the frame time present in the header.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
uint16_t GetProfileId () const
 Get the profile ID in the APS header.
 
uint32_t GetSerializedSize () const override
 
uint8_t GetSrcEndpoint () const
 Get the source endpoint in the APS header.
 
bool IsAckRequested () const
 Indicates if the present frame requires acknowledgment.
 
bool IsExtHeaderPresent () const
 Indicates whether or not the extended header is present in the frame.
 
bool IsSecurityEnabled () const
 Returns whether or not security is enabled for the present frame.alignas.
 
void Print (std::ostream &os) const override
 
void Serialize (Buffer::Iterator start) const override
 
void SetAckRequest (bool request)
 Set the acknowledment flag in the APS header.
 
void SetApsCounter (uint8_t counter)
 Set the value of the APS counter in the APS header.
 
void SetClusterId (uint16_t clusterId)
 Set the cluster id in the APS header.
 
void SetDeliveryMode (enum ApsDeliveryMode mode)
 Defines the mode in which this frame should be transmitted.
 
void SetDstEndpoint (uint8_t endpoint)
 Set the destination endpoint in the APS header.
 
void SetExtHeaderPresent (bool present)
 Enables or disables the usage of the extended header.
 
void SetFrameControl (uint8_t frameControl)
 Set the Bitmap representing the framecontrol portion of the APS header.
 
void SetFrameType (enum ApsFrameType frameType)
 Set the Frame type defined in the APS layer.
 
void SetProfileId (uint16_t profileId)
 Set the profile ID in the APS header.
 
void SetSecurity (bool enabled)
 Set whether or not security should be used to transmit the frame.
 
void SetSrcEndpoint (uint8_t endpoint)
 Set the source endpoint in the APS header.
 
- 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

uint8_t m_ackBitfield
 Extended header field: Acknowledgement bit field.
 
bool m_ackFormat
 Frame control field: Acknowledgment format.
 
bool m_ackRequest
 Frame control field: Acknowledge requested.
 
uint8_t m_apsCounter
 APS counter field.
 
uint8_t m_blockNumber
 Extended header field: Block number.
 
uint16_t m_clusterId
 Addressing field: Cluster ID.
 
ApsDeliveryMode m_deliveryMode
 Frame control field: Delivery mode.
 
uint8_t m_dstEndpoint
 Addressing field: Destination endpoint.
 
bool m_extHeaderPresent
 Frame control field: Extended header present.
 
ApsFragmentation m_fragmentation
 Extended header field: Fragmentation block type.
 
ApsFrameType m_frameType
 Frame control field: Frame type.
 
uint16_t m_groupAddress
 Addressing field: Group or 16-bit address.
 
uint16_t m_profileId
 Addressing field: Profile ID.
 
bool m_security
 Frame control field: Security.
 
uint8_t m_srcEndpoint
 Addressing field: Source endpoint.
 

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

Defines the APS header use by data transfer and commands issued from the APS layer.

Zigbee Specification r22.1.0, Section 2.2.5.1.

Definition at line 69 of file zigbee-aps-header.h.

Constructor & Destructor Documentation

◆ ZigbeeApsHeader()

ns3::zigbee::ZigbeeApsHeader::ZigbeeApsHeader ( )

◆ ~ZigbeeApsHeader()

ns3::zigbee::ZigbeeApsHeader::~ZigbeeApsHeader ( )
override

Definition at line 29 of file zigbee-aps-header.cc.

Member Function Documentation

◆ Deserialize()

uint32_t ns3::zigbee::ZigbeeApsHeader::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 212 of file zigbee-aps-header.cc.

References ns3::zigbee::APS_ACK, ns3::zigbee::APS_BCST, ns3::zigbee::APS_DATA, ns3::zigbee::APS_GROUP_ADDRESSING, ns3::zigbee::APS_UCST, ns3::Buffer::Iterator::GetDistanceFrom(), m_ackBitfield, m_ackFormat, m_ackRequest, m_apsCounter, m_blockNumber, m_clusterId, m_deliveryMode, m_dstEndpoint, m_extHeaderPresent, m_fragmentation, m_frameType, m_groupAddress, m_profileId, m_security, m_srcEndpoint, ns3::zigbee::NOT_FRAGMENTED, ns3::Buffer::Iterator::ReadLsbtohU16(), and ns3::Buffer::Iterator::ReadU8().

+ Here is the call graph for this function:

◆ GetApsCounter()

uint8_t ns3::zigbee::ZigbeeApsHeader::GetApsCounter ( ) const

Get the APS counter value present in the APS header.

Returns
The APS counter value.

Definition at line 148 of file zigbee-aps-header.cc.

References m_apsCounter.

◆ GetClusterId()

uint16_t ns3::zigbee::ZigbeeApsHeader::GetClusterId ( ) const

Get the cluster id in the APS header.

Returns
The cluster id.

Definition at line 112 of file zigbee-aps-header.cc.

References m_clusterId.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ GetDeliveryMode()

ApsDeliveryMode ns3::zigbee::ZigbeeApsHeader::GetDeliveryMode ( ) const

Get the transmission mode set on the header.

Returns
ApsDeliveryMode The delivery mode of the header

Definition at line 52 of file zigbee-aps-header.cc.

References m_deliveryMode.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ GetDstEndpoint()

uint8_t ns3::zigbee::ZigbeeApsHeader::GetDstEndpoint ( ) const

Get the destination endpoint in the APS header.

Returns
The destination endpoint.

Definition at line 100 of file zigbee-aps-header.cc.

References m_dstEndpoint.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ GetFrameControl()

uint8_t ns3::zigbee::ZigbeeApsHeader::GetFrameControl ( ) const

Get the frame control portion (bitmap) of the APS header.

Returns
The frame control portion of the APS header.

◆ GetFrameType()

ApsFrameType ns3::zigbee::ZigbeeApsHeader::GetFrameType ( ) const

Get the frame time present in the header.

Returns
ApsFrameType

Definition at line 40 of file zigbee-aps-header.cc.

References m_frameType.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::zigbee::ZigbeeApsHeader::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 340 of file zigbee-aps-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetProfileId()

uint16_t ns3::zigbee::ZigbeeApsHeader::GetProfileId ( ) const

Get the profile ID in the APS header.

Returns
The profile ID.

Definition at line 124 of file zigbee-aps-header.cc.

References m_profileId.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::zigbee::ZigbeeApsHeader::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 273 of file zigbee-aps-header.cc.

References ns3::zigbee::APS_ACK, ns3::zigbee::APS_BCST, ns3::zigbee::APS_DATA, ns3::zigbee::APS_GROUP_ADDRESSING, ns3::zigbee::APS_UCST, m_deliveryMode, m_extHeaderPresent, m_fragmentation, m_frameType, and ns3::zigbee::NOT_FRAGMENTED.

◆ GetSrcEndpoint()

uint8_t ns3::zigbee::ZigbeeApsHeader::GetSrcEndpoint ( ) const

Get the source endpoint in the APS header.

Returns
The source endpoint.

Definition at line 136 of file zigbee-aps-header.cc.

References m_srcEndpoint.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 330 of file zigbee-aps-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

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

◆ IsAckRequested()

bool ns3::zigbee::ZigbeeApsHeader::IsAckRequested ( ) const

Indicates if the present frame requires acknowledgment.

Returns
True if the frame requires acknowledgment

Definition at line 76 of file zigbee-aps-header.cc.

References m_ackRequest.

◆ IsExtHeaderPresent()

bool ns3::zigbee::ZigbeeApsHeader::IsExtHeaderPresent ( ) const

Indicates whether or not the extended header is present in the frame.

Returns
True if the extended header is present.

Definition at line 88 of file zigbee-aps-header.cc.

References m_extHeaderPresent.

Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().

+ Here is the caller graph for this function:

◆ IsSecurityEnabled()

bool ns3::zigbee::ZigbeeApsHeader::IsSecurityEnabled ( ) const

Returns whether or not security is enabled for the present frame.alignas.

Returns
True if security is enabled for the frame.

Definition at line 64 of file zigbee-aps-header.cc.

References m_security.

◆ Print()

void ns3::zigbee::ZigbeeApsHeader::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 346 of file zigbee-aps-header.cc.

◆ Serialize()

void ns3::zigbee::ZigbeeApsHeader::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 154 of file zigbee-aps-header.cc.

References ns3::zigbee::APS_ACK, ns3::zigbee::APS_BCST, ns3::zigbee::APS_DATA, ns3::zigbee::APS_GROUP_ADDRESSING, ns3::zigbee::APS_UCST, m_ackBitfield, m_ackFormat, m_ackRequest, m_apsCounter, m_blockNumber, m_clusterId, m_deliveryMode, m_dstEndpoint, m_extHeaderPresent, m_fragmentation, m_frameType, m_groupAddress, m_profileId, m_security, m_srcEndpoint, ns3::zigbee::NOT_FRAGMENTED, ns3::Buffer::Iterator::WriteHtolsbU16(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

◆ SetAckRequest()

void ns3::zigbee::ZigbeeApsHeader::SetAckRequest ( bool request)

Set the acknowledment flag in the APS header.

Parameters
requestTrue if the frame should be acknowledged

Definition at line 70 of file zigbee-aps-header.cc.

References m_ackRequest.

◆ SetApsCounter()

void ns3::zigbee::ZigbeeApsHeader::SetApsCounter ( uint8_t counter)

Set the value of the APS counter in the APS header.

Parameters
counterThe APS counter value.

Definition at line 142 of file zigbee-aps-header.cc.

References m_apsCounter.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

◆ SetClusterId()

void ns3::zigbee::ZigbeeApsHeader::SetClusterId ( uint16_t clusterId)

Set the cluster id in the APS header.

Parameters
clusterIdThe cluster id

Definition at line 106 of file zigbee-aps-header.cc.

References m_clusterId.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

◆ SetDeliveryMode()

void ns3::zigbee::ZigbeeApsHeader::SetDeliveryMode ( enum ApsDeliveryMode mode)

Defines the mode in which this frame should be transmitted.

Parameters
modeThe delivery mode to set on the APS header

Definition at line 46 of file zigbee-aps-header.cc.

References m_deliveryMode.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

◆ SetDstEndpoint()

void ns3::zigbee::ZigbeeApsHeader::SetDstEndpoint ( uint8_t endpoint)

Set the destination endpoint in the APS header.

Parameters
endpointThe destination endpoint.

Definition at line 94 of file zigbee-aps-header.cc.

References m_dstEndpoint.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst().

+ Here is the caller graph for this function:

◆ SetExtHeaderPresent()

void ns3::zigbee::ZigbeeApsHeader::SetExtHeaderPresent ( bool present)

Enables or disables the usage of the extended header.

Only used when fragmentation is used.

Parameters
presentTrue if the extended header (fragmentation) is present.

Definition at line 82 of file zigbee-aps-header.cc.

References m_extHeaderPresent.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

◆ SetFrameControl()

void ns3::zigbee::ZigbeeApsHeader::SetFrameControl ( uint8_t frameControl)

Set the Bitmap representing the framecontrol portion of the APS header.

Parameters
frameControlThe bitmap representing the framecontrol portion.

◆ SetFrameType()

void ns3::zigbee::ZigbeeApsHeader::SetFrameType ( enum ApsFrameType frameType)

Set the Frame type defined in the APS layer.

Parameters
frameTypeThe frame type to set on the header

Definition at line 34 of file zigbee-aps-header.cc.

References m_frameType.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

◆ SetProfileId()

void ns3::zigbee::ZigbeeApsHeader::SetProfileId ( uint16_t profileId)

Set the profile ID in the APS header.

Parameters
profileIdThe profile ID.

Definition at line 118 of file zigbee-aps-header.cc.

References m_profileId.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

◆ SetSecurity()

void ns3::zigbee::ZigbeeApsHeader::SetSecurity ( bool enabled)

Set whether or not security should be used to transmit the frame.

Parameters
enabledTrue if security should be used

Definition at line 58 of file zigbee-aps-header.cc.

References m_security.

◆ SetSrcEndpoint()

void ns3::zigbee::ZigbeeApsHeader::SetSrcEndpoint ( uint8_t endpoint)

Set the source endpoint in the APS header.

Parameters
endpointThe source endpoint.

Definition at line 130 of file zigbee-aps-header.cc.

References m_srcEndpoint.

Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst(), and ns3::zigbee::ZigbeeAps::SendDataWithBindingTable().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ackBitfield

uint8_t ns3::zigbee::ZigbeeApsHeader::m_ackBitfield
private

Extended header field: Acknowledgement bit field.

Definition at line 258 of file zigbee-aps-header.h.

Referenced by Deserialize(), and Serialize().

◆ m_ackFormat

bool ns3::zigbee::ZigbeeApsHeader::m_ackFormat
private

Frame control field: Acknowledgment format.

Definition at line 241 of file zigbee-aps-header.h.

Referenced by ZigbeeApsHeader(), Deserialize(), and Serialize().

◆ m_ackRequest

bool ns3::zigbee::ZigbeeApsHeader::m_ackRequest
private

Frame control field: Acknowledge requested.

Definition at line 243 of file zigbee-aps-header.h.

Referenced by ZigbeeApsHeader(), Deserialize(), IsAckRequested(), Serialize(), and SetAckRequest().

◆ m_apsCounter

uint8_t ns3::zigbee::ZigbeeApsHeader::m_apsCounter
private

APS counter field.

Definition at line 253 of file zigbee-aps-header.h.

Referenced by Deserialize(), GetApsCounter(), Serialize(), and SetApsCounter().

◆ m_blockNumber

uint8_t ns3::zigbee::ZigbeeApsHeader::m_blockNumber
private

Extended header field: Block number.

Definition at line 257 of file zigbee-aps-header.h.

Referenced by Deserialize(), and Serialize().

◆ m_clusterId

uint16_t ns3::zigbee::ZigbeeApsHeader::m_clusterId
private

Addressing field: Cluster ID.

Definition at line 249 of file zigbee-aps-header.h.

Referenced by Deserialize(), GetClusterId(), Serialize(), and SetClusterId().

◆ m_deliveryMode

ApsDeliveryMode ns3::zigbee::ZigbeeApsHeader::m_deliveryMode
private

Frame control field: Delivery mode.

Definition at line 240 of file zigbee-aps-header.h.

Referenced by ZigbeeApsHeader(), Deserialize(), GetDeliveryMode(), GetSerializedSize(), Serialize(), and SetDeliveryMode().

◆ m_dstEndpoint

uint8_t ns3::zigbee::ZigbeeApsHeader::m_dstEndpoint
private

Addressing field: Destination endpoint.

Definition at line 247 of file zigbee-aps-header.h.

Referenced by Deserialize(), GetDstEndpoint(), Serialize(), and SetDstEndpoint().

◆ m_extHeaderPresent

bool ns3::zigbee::ZigbeeApsHeader::m_extHeaderPresent
private

Frame control field: Extended header present.

Definition at line 244 of file zigbee-aps-header.h.

Referenced by ZigbeeApsHeader(), Deserialize(), GetSerializedSize(), IsExtHeaderPresent(), Serialize(), and SetExtHeaderPresent().

◆ m_fragmentation

ApsFragmentation ns3::zigbee::ZigbeeApsHeader::m_fragmentation
private

Extended header field: Fragmentation block type.

Definition at line 256 of file zigbee-aps-header.h.

Referenced by Deserialize(), GetSerializedSize(), and Serialize().

◆ m_frameType

ApsFrameType ns3::zigbee::ZigbeeApsHeader::m_frameType
private

Frame control field: Frame type.

Definition at line 239 of file zigbee-aps-header.h.

Referenced by ZigbeeApsHeader(), Deserialize(), GetFrameType(), GetSerializedSize(), Serialize(), and SetFrameType().

◆ m_groupAddress

uint16_t ns3::zigbee::ZigbeeApsHeader::m_groupAddress
private

Addressing field: Group or 16-bit address.

Definition at line 248 of file zigbee-aps-header.h.

Referenced by Deserialize(), and Serialize().

◆ m_profileId

uint16_t ns3::zigbee::ZigbeeApsHeader::m_profileId
private

Addressing field: Profile ID.

Definition at line 250 of file zigbee-aps-header.h.

Referenced by Deserialize(), GetProfileId(), Serialize(), and SetProfileId().

◆ m_security

bool ns3::zigbee::ZigbeeApsHeader::m_security
private

Frame control field: Security.

Definition at line 242 of file zigbee-aps-header.h.

Referenced by ZigbeeApsHeader(), Deserialize(), IsSecurityEnabled(), Serialize(), and SetSecurity().

◆ m_srcEndpoint

uint8_t ns3::zigbee::ZigbeeApsHeader::m_srcEndpoint
private

Addressing field: Source endpoint.

Definition at line 251 of file zigbee-aps-header.h.

Referenced by Deserialize(), GetSrcEndpoint(), Serialize(), and SetSrcEndpoint().


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