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

Implementation of the LinkAdrAns LoRaWAN MAC command. More...

#include "mac-command.h"

Inheritance diagram for ns3::lorawan::LinkAdrAns:
Collaboration diagram for ns3::lorawan::LinkAdrAns:

Public Member Functions

 LinkAdrAns ()
 Default constructor.
 LinkAdrAns (bool powerAck, bool dataRateAck, bool channelMaskAck)
 Constructor with given fields.
uint8_t Deserialize (Buffer::Iterator &start) override
 Deserialize the buffer into a MAC command.
bool GetChannelMaskAck () const
 Get the ChannelMaskAck field value of the LinkAdrAns command.
bool GetDataRateAck () const
 Get the DataRateAck field value of the LinkAdrAns command.
bool GetPowerAck () const
 Get the PowerAck field value of the LinkAdrAns command.
void Print (std::ostream &os) const override
 Print the contents of this MAC command in human-readable format.
void Serialize (Buffer::Iterator &start) const override
 Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
Public Member Functions inherited from ns3::lorawan::MacCommand
 MacCommand ()
 Default constructor.
virtual ~MacCommand ()
 Destructor.
virtual enum MacCommandType GetCommandType () const
 Get the commandType of this MAC command.
virtual uint8_t GetSerializedSize () const
 Get serialized length of this MAC command.
Public Member Functions inherited from ns3::SimpleRefCount< MacCommand >
 SimpleRefCount ()
 Default constructor.
uint32_t GetReferenceCount () const
 Get the reference count of the object.
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
void Ref () const
 Increment the reference count.
void Unref () const
 Decrement the reference count.

Private Attributes

bool m_channelMaskAck
 The ChannelMaskACK field.
bool m_dataRateAck
 The DataRateACK field.
bool m_powerAck
 The PowerACK field.

Additional Inherited Members

Static Public Member Functions inherited from ns3::lorawan::MacCommand
static uint8_t GetCIDFromMacCommand (enum MacCommandType commandType)
 Get the CID that corresponds to a type of MAC command.
Protected Attributes inherited from ns3::lorawan::MacCommand
enum MacCommandType m_commandType
 The type of this command.
uint8_t m_serializedSize
 This MAC command's serialized size.

Detailed Description

Implementation of the LinkAdrAns LoRaWAN MAC command.

With this command, the end device acknowledges a LinkAdrReq.

Definition at line 270 of file mac-command.h.

Constructor & Destructor Documentation

◆ LinkAdrAns() [1/2]

ns3::lorawan::LinkAdrAns::LinkAdrAns ( )

◆ LinkAdrAns() [2/2]

ns3::lorawan::LinkAdrAns::LinkAdrAns ( bool powerAck,
bool dataRateAck,
bool channelMaskAck )

Constructor with given fields.

Parameters
powerAckThe PowerACK field to set.
dataRateAckThe DataRateACK field to set.
channelMaskAckThe ChannelMaskACK field to set.

Definition at line 307 of file mac-command.cc.

References ns3::lorawan::LINK_ADR_ANS, m_channelMaskAck, ns3::lorawan::MacCommand::m_commandType, m_dataRateAck, m_powerAck, ns3::lorawan::MacCommand::m_serializedSize, and NS_LOG_FUNCTION.

Member Function Documentation

◆ Deserialize()

uint8_t ns3::lorawan::LinkAdrAns::Deserialize ( Buffer::Iterator & start)
overridevirtual

Deserialize the buffer into a MAC command.

Parameters
startA pointer to the buffer that contains the serialized command.
Returns
The number of bytes that were consumed.

Implements ns3::lorawan::MacCommand.

Definition at line 327 of file mac-command.cc.

References m_channelMaskAck, m_dataRateAck, m_powerAck, ns3::lorawan::MacCommand::m_serializedSize, and NS_LOG_FUNCTION.

◆ GetChannelMaskAck()

bool ns3::lorawan::LinkAdrAns::GetChannelMaskAck ( ) const

Get the ChannelMaskAck field value of the LinkAdrAns command.

Returns
true The channel mask sent was successfully interpreted. All currently defined channel states were set according to the mask.
false The channel mask enables a yet undefined channel or the channel mask required all channels to be disabled or the channel mask is incompatible with the resulting data rate or TX power. The command was discarded, and the end-device state was not changed.

Definition at line 364 of file mac-command.cc.

References m_channelMaskAck, and NS_LOG_FUNCTION.

◆ GetDataRateAck()

bool ns3::lorawan::LinkAdrAns::GetDataRateAck ( ) const

Get the DataRateAck field value of the LinkAdrAns command.

Returns
true The data rate was successfully set.
false The data rate requested is unknown to the end-device or is not possible, given the channel mask provided (not supported by any of the enabled channels). The command was discarded, and the end-device state was not changed.

Definition at line 357 of file mac-command.cc.

References m_dataRateAck, and NS_LOG_FUNCTION.

◆ GetPowerAck()

bool ns3::lorawan::LinkAdrAns::GetPowerAck ( ) const

Get the PowerAck field value of the LinkAdrAns command.

Returns
true The power level was successfully set.
false The end-device is unable to operate at or below the requested power level. The command was discarded and the end-device state was not changed.

Definition at line 350 of file mac-command.cc.

References m_powerAck, and NS_LOG_FUNCTION.

◆ Print()

void ns3::lorawan::LinkAdrAns::Print ( std::ostream & os) const
overridevirtual

Print the contents of this MAC command in human-readable format.

Parameters
osThe std::ostream instance on which to print the MAC command.

Implements ns3::lorawan::MacCommand.

Definition at line 339 of file mac-command.cc.

References m_channelMaskAck, m_dataRateAck, m_powerAck, and NS_LOG_FUNCTION.

◆ Serialize()

void ns3::lorawan::LinkAdrAns::Serialize ( Buffer::Iterator & start) const
overridevirtual

Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.

Parameters
startA pointer to the buffer into which to serialize the command.

Implements ns3::lorawan::MacCommand.

Definition at line 318 of file mac-command.cc.

References ns3::lorawan::MacCommand::GetCIDFromMacCommand(), m_channelMaskAck, ns3::lorawan::MacCommand::m_commandType, m_dataRateAck, m_powerAck, and NS_LOG_FUNCTION.

Here is the call graph for this function:

Member Data Documentation

◆ m_channelMaskAck

bool ns3::lorawan::LinkAdrAns::m_channelMaskAck
private

The ChannelMaskACK field.

Definition at line 321 of file mac-command.h.

Referenced by LinkAdrAns(), Deserialize(), GetChannelMaskAck(), Print(), and Serialize().

◆ m_dataRateAck

bool ns3::lorawan::LinkAdrAns::m_dataRateAck
private

The DataRateACK field.

Definition at line 320 of file mac-command.h.

Referenced by LinkAdrAns(), Deserialize(), GetDataRateAck(), Print(), and Serialize().

◆ m_powerAck

bool ns3::lorawan::LinkAdrAns::m_powerAck
private

The PowerACK field.

Definition at line 319 of file mac-command.h.

Referenced by LinkAdrAns(), Deserialize(), GetPowerAck(), Print(), and Serialize().


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