Represent the Capability Information Field. More...
#include "lr-wpan-fields.h"
Public Member Functions | |
CapabilityField () | |
CapabilityField (uint8_t bitmap) | |
Construct a Capability field based on a bitmap. | |
Buffer::Iterator | Deserialize (Buffer::Iterator i) |
Deserialize the entire Capability Information Field. | |
uint8_t | GetCapability () const |
Get the bitmap representing the device capability. | |
uint32_t | GetSerializedSize () const |
Get the size of the serialized Capability Information Field. | |
bool | IsDeviceTypeFfd () const |
True if the device type is a Full Functional Device (FFD) false if is a Reduced Functional Device (RFD). | |
bool | IsPowSrcAvailable () const |
True if the device is receiving power from alternating current mains. | |
bool | IsReceiverOnWhenIdle () const |
True if the device does not disable its receiver to conserve power during idle periods. | |
bool | IsSecurityCapability () const |
True if the device is capable of sending and receiving cryptographically protected MAC frames. | |
bool | IsShortAddrAllocOn () const |
True if the device wishes the coordinator to allocate a short address as result of the association procedure. | |
Buffer::Iterator | Serialize (Buffer::Iterator i) const |
Serialize the entire Capability Information Field. | |
void | SetCapability (uint8_t bitmap) |
Set the bitmap representing the device capability. | |
void | SetFfdDevice (bool devType) |
Set the Device type in the Capability Information Field. | |
void | SetPowSrcAvailable (bool pow) |
Set the Power Source available flag in the Capability Information Field. | |
void | SetRxOnWhenIdle (bool rxIdle) |
Indicate if the receiver is On on Idle. | |
void | SetSecurityCap (bool sec) |
Set the Security Capability flag in the Capability Information Field. | |
void | SetShortAddrAllocOn (bool addrAlloc) |
Set the Short Address Flag in the Capability Information Field. | |
Private Attributes | |
bool | m_allocAddr |
Capability Information Field, Allocate Address (bit 7) | |
bool | m_deviceType |
Capability Information Field, Device Type (bit 1) | |
bool | m_powerSource |
Capability Information Field, Power Source (bit 2) | |
bool | m_receiverOnWhenIdle |
Capability Information Field, Receiver On When Idle (bit 3) | |
bool | m_reservedBit0 |
Capability Information Field, Reserved (bit 0) | |
uint8_t | m_reservedBit45 |
Capability Information Field, Reserved (bit 4 & 5) | |
bool | m_securityCap |
Capability Information Field, Security Capability (bit 6) | |
Represent the Capability Information Field.
See IEEE 802.15.4-2011 Section 5.3.1.2 Figure 50
Definition at line 354 of file lr-wpan-fields.h.
ns3::CapabilityField::CapabilityField | ( | ) |
Definition at line 486 of file lr-wpan-fields.cc.
References m_allocAddr, m_deviceType, m_powerSource, m_receiverOnWhenIdle, and m_securityCap.
ns3::CapabilityField::CapabilityField | ( | uint8_t | bitmap | ) |
Construct a Capability field based on a bitmap.
bitmap | The bitmap representing the capability |
Definition at line 495 of file lr-wpan-fields.cc.
References SetCapability().
Buffer::Iterator ns3::CapabilityField::Deserialize | ( | Buffer::Iterator | i | ) |
Deserialize the entire Capability Information Field.
i | an iterator which points to where the Capability information field should be read. |
Definition at line 542 of file lr-wpan-fields.cc.
References ns3::Buffer::Iterator::ReadU8(), and SetCapability().
Referenced by ns3::CommandPayloadHeader::Deserialize().
uint8_t ns3::CapabilityField::GetCapability | ( | ) | const |
Get the bitmap representing the device capability.
< Bit 0 (reserved)
< Bit 1
< Bit 2
< Bit 3
< Bit 4-5 (reserved)
< Bit 6
< Bit 7
Definition at line 501 of file lr-wpan-fields.cc.
References m_allocAddr, m_deviceType, m_powerSource, m_receiverOnWhenIdle, m_reservedBit0, m_reservedBit45, and m_securityCap.
Referenced by Serialize().
uint32_t ns3::CapabilityField::GetSerializedSize | ( | ) | const |
Get the size of the serialized Capability Information Field.
Definition at line 529 of file lr-wpan-fields.cc.
Referenced by ns3::CommandPayloadHeader::GetSerializedSize().
bool ns3::CapabilityField::IsDeviceTypeFfd | ( | ) | const |
True if the device type is a Full Functional Device (FFD) false if is a Reduced Functional Device (RFD).
Definition at line 550 of file lr-wpan-fields.cc.
References m_deviceType.
Referenced by ns3::operator<<(), and ns3::CommandPayloadHeader::Print().
bool ns3::CapabilityField::IsPowSrcAvailable | ( | ) | const |
True if the device is receiving power from alternating current mains.
Definition at line 556 of file lr-wpan-fields.cc.
References m_powerSource.
Referenced by ns3::operator<<(), and ns3::CommandPayloadHeader::Print().
bool ns3::CapabilityField::IsReceiverOnWhenIdle | ( | ) | const |
True if the device does not disable its receiver to conserve power during idle periods.
Definition at line 562 of file lr-wpan-fields.cc.
References m_receiverOnWhenIdle.
Referenced by ns3::operator<<(), and ns3::CommandPayloadHeader::Print().
bool ns3::CapabilityField::IsSecurityCapability | ( | ) | const |
True if the device is capable of sending and receiving cryptographically protected MAC frames.
Definition at line 568 of file lr-wpan-fields.cc.
References m_securityCap.
Referenced by ns3::operator<<(), and ns3::CommandPayloadHeader::Print().
bool ns3::CapabilityField::IsShortAddrAllocOn | ( | ) | const |
True if the device wishes the coordinator to allocate a short address as result of the association procedure.
Definition at line 574 of file lr-wpan-fields.cc.
References m_allocAddr.
Referenced by ns3::operator<<(), and ns3::CommandPayloadHeader::Print().
Buffer::Iterator ns3::CapabilityField::Serialize | ( | Buffer::Iterator | i | ) | const |
Serialize the entire Capability Information Field.
i | an iterator which points to where the Capability information field should be written. |
Definition at line 535 of file lr-wpan-fields.cc.
References GetCapability(), and ns3::Buffer::Iterator::WriteU8().
Referenced by ns3::CommandPayloadHeader::Serialize().
void ns3::CapabilityField::SetCapability | ( | uint8_t | bitmap | ) |
Set the bitmap representing the device capability.
bitmap | The bitmap representing the capability |
< Bit 0 (reserved)
< Bit 1
< Bit 2
< Bit 3
< Bit 4-5 (reserved)
< Bit 6
< Bit 7
Definition at line 517 of file lr-wpan-fields.cc.
References m_allocAddr, m_deviceType, m_powerSource, m_receiverOnWhenIdle, m_reservedBit0, m_reservedBit45, and m_securityCap.
Referenced by CapabilityField(), and Deserialize().
void ns3::CapabilityField::SetFfdDevice | ( | bool | devType | ) |
Set the Device type in the Capability Information Field.
True = full functional device (FFD) False = reduced functional device (RFD).
devType | The device type described in the Capability Information Field. |
Definition at line 580 of file lr-wpan-fields.cc.
References m_deviceType.
void ns3::CapabilityField::SetPowSrcAvailable | ( | bool | pow | ) |
Set the Power Source available flag in the Capability Information Field.
pow | Set true if a Power Source is available in the Capability Information Field. |
Definition at line 586 of file lr-wpan-fields.cc.
References m_powerSource.
void ns3::CapabilityField::SetRxOnWhenIdle | ( | bool | rxIdle | ) |
Indicate if the receiver is On on Idle.
rxIdle | Set true if the receiver is on when Idle |
Definition at line 592 of file lr-wpan-fields.cc.
References m_receiverOnWhenIdle.
void ns3::CapabilityField::SetSecurityCap | ( | bool | sec | ) |
Set the Security Capability flag in the Capability Information Field.
sec | Set true if the device have Security Capabilities. |
Definition at line 598 of file lr-wpan-fields.cc.
References m_securityCap.
void ns3::CapabilityField::SetShortAddrAllocOn | ( | bool | addrAlloc | ) |
Set the Short Address Flag in the Capability Information Field.
addrAlloc | Describes whether or not the coordinator should allocate a short address in the association process. |
Definition at line 604 of file lr-wpan-fields.cc.
References m_allocAddr.
Referenced by ScanConfirm().
|
private |
Capability Information Field, Allocate Address (bit 7)
Definition at line 490 of file lr-wpan-fields.h.
Referenced by CapabilityField(), GetCapability(), IsShortAddrAllocOn(), SetCapability(), and SetShortAddrAllocOn().
|
private |
Capability Information Field, Device Type (bit 1)
Definition at line 485 of file lr-wpan-fields.h.
Referenced by CapabilityField(), GetCapability(), IsDeviceTypeFfd(), SetCapability(), and SetFfdDevice().
|
private |
Capability Information Field, Power Source (bit 2)
Definition at line 486 of file lr-wpan-fields.h.
Referenced by CapabilityField(), GetCapability(), IsPowSrcAvailable(), SetCapability(), and SetPowSrcAvailable().
|
private |
Capability Information Field, Receiver On When Idle (bit 3)
Definition at line 487 of file lr-wpan-fields.h.
Referenced by CapabilityField(), GetCapability(), IsReceiverOnWhenIdle(), SetCapability(), and SetRxOnWhenIdle().
|
private |
Capability Information Field, Reserved (bit 0)
Definition at line 484 of file lr-wpan-fields.h.
Referenced by GetCapability(), and SetCapability().
|
private |
Capability Information Field, Reserved (bit 4 & 5)
Definition at line 488 of file lr-wpan-fields.h.
Referenced by GetCapability(), and SetCapability().
|
private |
Capability Information Field, Security Capability (bit 6)
Definition at line 489 of file lr-wpan-fields.h.
Referenced by CapabilityField(), GetCapability(), IsSecurityCapability(), SetCapability(), and SetSecurityCap().