Defines the APS header use by data transfer and commands issued from the APS layer. More...
#include "zigbee-aps-header.h"
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. | |
![]() | |
~Header () override | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. | |
![]() | |
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 TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
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 | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
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.
ns3::zigbee::ZigbeeApsHeader::ZigbeeApsHeader | ( | ) |
Definition at line 19 of file zigbee-aps-header.cc.
References ns3::zigbee::APS_DATA, ns3::zigbee::APS_UCST, m_ackFormat, m_ackRequest, m_deliveryMode, m_extHeaderPresent, m_frameType, and m_security.
|
override |
Definition at line 29 of file zigbee-aps-header.cc.
|
overridevirtual |
start | an iterator which points to where the header should read from. |
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().
uint8_t ns3::zigbee::ZigbeeApsHeader::GetApsCounter | ( | ) | const |
Get the APS counter value present in the APS header.
Definition at line 148 of file zigbee-aps-header.cc.
References m_apsCounter.
uint16_t ns3::zigbee::ZigbeeApsHeader::GetClusterId | ( | ) | const |
Get the cluster id in the APS header.
Definition at line 112 of file zigbee-aps-header.cc.
References m_clusterId.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
ApsDeliveryMode ns3::zigbee::ZigbeeApsHeader::GetDeliveryMode | ( | ) | const |
Get the transmission mode set on the header.
Definition at line 52 of file zigbee-aps-header.cc.
References m_deliveryMode.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
uint8_t ns3::zigbee::ZigbeeApsHeader::GetDstEndpoint | ( | ) | const |
Get the destination endpoint in the APS header.
Definition at line 100 of file zigbee-aps-header.cc.
References m_dstEndpoint.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
uint8_t ns3::zigbee::ZigbeeApsHeader::GetFrameControl | ( | ) | const |
Get the frame control portion (bitmap) of the APS header.
ApsFrameType ns3::zigbee::ZigbeeApsHeader::GetFrameType | ( | ) | const |
Get the frame time present in the header.
Definition at line 40 of file zigbee-aps-header.cc.
References m_frameType.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
|
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()
.
Implements ns3::ObjectBase.
Definition at line 340 of file zigbee-aps-header.cc.
References GetTypeId().
uint16_t ns3::zigbee::ZigbeeApsHeader::GetProfileId | ( | ) | const |
Get the profile ID in the APS header.
Definition at line 124 of file zigbee-aps-header.cc.
References m_profileId.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
|
overridevirtual |
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.
uint8_t ns3::zigbee::ZigbeeApsHeader::GetSrcEndpoint | ( | ) | const |
Get the source endpoint in the APS header.
Definition at line 136 of file zigbee-aps-header.cc.
References m_srcEndpoint.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
|
static |
Get the type ID.
Definition at line 330 of file zigbee-aps-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
bool ns3::zigbee::ZigbeeApsHeader::IsAckRequested | ( | ) | const |
Indicates if the present frame requires acknowledgment.
Definition at line 76 of file zigbee-aps-header.cc.
References m_ackRequest.
bool ns3::zigbee::ZigbeeApsHeader::IsExtHeaderPresent | ( | ) | const |
Indicates whether or not the extended header is present in the frame.
Definition at line 88 of file zigbee-aps-header.cc.
References m_extHeaderPresent.
Referenced by ns3::zigbee::ZigbeeAps::NldeDataIndication().
bool ns3::zigbee::ZigbeeApsHeader::IsSecurityEnabled | ( | ) | const |
Returns whether or not security is enabled for the present frame.alignas.
Definition at line 64 of file zigbee-aps-header.cc.
References m_security.
|
overridevirtual |
os | output 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.
|
overridevirtual |
start | an 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().
void ns3::zigbee::ZigbeeApsHeader::SetAckRequest | ( | bool | request | ) |
Set the acknowledment flag in the APS header.
request | True if the frame should be acknowledged |
Definition at line 70 of file zigbee-aps-header.cc.
References m_ackRequest.
void ns3::zigbee::ZigbeeApsHeader::SetApsCounter | ( | uint8_t | counter | ) |
Set the value of the APS counter in the APS header.
counter | The 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().
void ns3::zigbee::ZigbeeApsHeader::SetClusterId | ( | uint16_t | clusterId | ) |
Set the cluster id in the APS header.
clusterId | The 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().
void ns3::zigbee::ZigbeeApsHeader::SetDeliveryMode | ( | enum ApsDeliveryMode | mode | ) |
Defines the mode in which this frame should be transmitted.
mode | The 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().
void ns3::zigbee::ZigbeeApsHeader::SetDstEndpoint | ( | uint8_t | endpoint | ) |
Set the destination endpoint in the APS header.
endpoint | The destination endpoint. |
Definition at line 94 of file zigbee-aps-header.cc.
References m_dstEndpoint.
Referenced by ns3::zigbee::ZigbeeAps::SendDataUcstBcst().
void ns3::zigbee::ZigbeeApsHeader::SetExtHeaderPresent | ( | bool | present | ) |
Enables or disables the usage of the extended header.
Only used when fragmentation is used.
present | True 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().
void ns3::zigbee::ZigbeeApsHeader::SetFrameControl | ( | uint8_t | frameControl | ) |
Set the Bitmap representing the framecontrol portion of the APS header.
frameControl | The bitmap representing the framecontrol portion. |
void ns3::zigbee::ZigbeeApsHeader::SetFrameType | ( | enum ApsFrameType | frameType | ) |
Set the Frame type defined in the APS layer.
frameType | The 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().
void ns3::zigbee::ZigbeeApsHeader::SetProfileId | ( | uint16_t | profileId | ) |
Set the profile ID in the APS header.
profileId | The 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().
void ns3::zigbee::ZigbeeApsHeader::SetSecurity | ( | bool | enabled | ) |
Set whether or not security should be used to transmit the frame.
enabled | True if security should be used |
Definition at line 58 of file zigbee-aps-header.cc.
References m_security.
void ns3::zigbee::ZigbeeApsHeader::SetSrcEndpoint | ( | uint8_t | endpoint | ) |
Set the source endpoint in the APS header.
endpoint | The 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().
|
private |
Extended header field: Acknowledgement bit field.
Definition at line 258 of file zigbee-aps-header.h.
Referenced by Deserialize(), and Serialize().
|
private |
Frame control field: Acknowledgment format.
Definition at line 241 of file zigbee-aps-header.h.
Referenced by ZigbeeApsHeader(), Deserialize(), and Serialize().
|
private |
Frame control field: Acknowledge requested.
Definition at line 243 of file zigbee-aps-header.h.
Referenced by ZigbeeApsHeader(), Deserialize(), IsAckRequested(), Serialize(), and SetAckRequest().
|
private |
APS counter field.
Definition at line 253 of file zigbee-aps-header.h.
Referenced by Deserialize(), GetApsCounter(), Serialize(), and SetApsCounter().
|
private |
Extended header field: Block number.
Definition at line 257 of file zigbee-aps-header.h.
Referenced by Deserialize(), and Serialize().
|
private |
Addressing field: Cluster ID.
Definition at line 249 of file zigbee-aps-header.h.
Referenced by Deserialize(), GetClusterId(), Serialize(), and SetClusterId().
|
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().
|
private |
Addressing field: Destination endpoint.
Definition at line 247 of file zigbee-aps-header.h.
Referenced by Deserialize(), GetDstEndpoint(), Serialize(), and SetDstEndpoint().
|
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().
|
private |
Extended header field: Fragmentation block type.
Definition at line 256 of file zigbee-aps-header.h.
Referenced by Deserialize(), GetSerializedSize(), and Serialize().
|
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().
|
private |
Addressing field: Group or 16-bit address.
Definition at line 248 of file zigbee-aps-header.h.
Referenced by Deserialize(), and Serialize().
|
private |
Addressing field: Profile ID.
Definition at line 250 of file zigbee-aps-header.h.
Referenced by Deserialize(), GetProfileId(), Serialize(), and SetProfileId().
|
private |
Frame control field: Security.
Definition at line 242 of file zigbee-aps-header.h.
Referenced by ZigbeeApsHeader(), Deserialize(), IsSecurityEnabled(), Serialize(), and SetSecurity().
|
private |
Addressing field: Source endpoint.
Definition at line 251 of file zigbee-aps-header.h.
Referenced by Deserialize(), GetSrcEndpoint(), Serialize(), and SetSrcEndpoint().