ns3::LinkAdrReq Class Reference

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

#include "lorawan-mac-command.h"

+ Inheritance diagram for ns3::LinkAdrReq:
+ Collaboration diagram for ns3::LinkAdrReq:

Public Member Functions

 LinkAdrReq ()
 
 LinkAdrReq (uint8_t dataRate, uint8_t txPower, uint16_t channelMask, uint8_t chMaskCntl, uint8_t nbRep)
 
virtual uint8_t Deserialize (Buffer::Iterator &start)
 Deserialize the buffer into a MAC command. More...
 
uint8_t GetDataRate (void)
 Return the data rate prescribed by this MAC command. More...
 
std::list< int > GetEnabledChannelsList (void)
 Get the list of enabled channels. More...
 
int GetRepetitions (void)
 Get the number of repetitions prescribed by this MAC command. More...
 
uint8_t GetTxPower (void)
 Get the transmission power prescribed by this MAC command. More...
 
virtual void Print (std::ostream &os) const
 Print the contents of this MAC command in human-readable format. More...
 
virtual void Serialize (Buffer::Iterator &start) const
 Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard. More...
 
- Public Member Functions inherited from ns3::LorawanMacCommand
 LorawanMacCommand ()
 
virtual ~LorawanMacCommand ()
 
virtual enum MacCommandType GetCommandType (void) const
 Get the commandType of this MAC command. More...
 
virtual uint8_t GetSerializedSize (void) const
 Get serialized length of this MAC command. More...
 

Private Attributes

uint16_t m_channelMask
 
uint8_t m_chMaskCntl
 
uint8_t m_dataRate
 
uint8_t m_nbRep
 
uint8_t m_txPower
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::LorawanMacCommand
static uint8_t GetCIDFromLorawanMacCommand (enum MacCommandType commandType)
 Get the CID that corresponds to this MAC command. More...
 
static TypeId GetTypeId (void)
 
- Protected Attributes inherited from ns3::LorawanMacCommand
enum MacCommandType m_commandType
 The type of this command. More...
 
uint8_t m_serializedSize
 This MAC command's serialized size. More...
 

Detailed Description

Implementation of the LinkAdrReq LoRaWAN MAC command.

With this command, the network server can request a device to change its data rate, transmission power and the channel it uses for uplink transmissions.

Definition at line 213 of file lorawan-mac-command.h.

Constructor & Destructor Documentation

◆ LinkAdrReq() [1/2]

ns3::LinkAdrReq::LinkAdrReq ( )

◆ LinkAdrReq() [2/2]

ns3::LinkAdrReq::LinkAdrReq ( uint8_t  dataRate,
uint8_t  txPower,
uint16_t  channelMask,
uint8_t  chMaskCntl,
uint8_t  nbRep 
)

Member Function Documentation

◆ Deserialize()

uint8_t ns3::LinkAdrReq::Deserialize ( Buffer::Iterator &  start)
virtual

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::LorawanMacCommand.

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

References m_channelMask, m_chMaskCntl, m_dataRate, m_nbRep, ns3::LorawanMacCommand::m_serializedSize, and m_txPower.

◆ GetDataRate()

uint8_t ns3::LinkAdrReq::GetDataRate ( void  )

Return the data rate prescribed by this MAC command.

Returns
An unsigned 8-bit integer containing the data rate.

Definition at line 338 of file lorawan-mac-command.cc.

References m_dataRate.

◆ GetEnabledChannelsList()

std::list< int > ns3::LinkAdrReq::GetEnabledChannelsList ( void  )

Get the list of enabled channels.

This method takes the 16-bit channel mask and translates it to a list of integers that can be more easily parsed.

Returns
The list of enabled channels.

Definition at line 354 of file lorawan-mac-command.cc.

References m_channelMask.

◆ GetRepetitions()

int ns3::LinkAdrReq::GetRepetitions ( void  )

Get the number of repetitions prescribed by this MAC command.

Returns
The number of repetitions.

Definition at line 372 of file lorawan-mac-command.cc.

References m_nbRep.

◆ GetTxPower()

uint8_t ns3::LinkAdrReq::GetTxPower ( void  )

Get the transmission power prescribed by this MAC command.

The MAC layer is expected to translate this value to a certain power in dBm when communicating it to the PHY, and the translation will vary based on the region of the device.

Returns
The TX power, encoded as an unsigned 8-bit integer.

Definition at line 346 of file lorawan-mac-command.cc.

References m_txPower.

◆ Print()

void ns3::LinkAdrReq::Print ( std::ostream &  os) const
virtual

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::LorawanMacCommand.

Definition at line 325 of file lorawan-mac-command.cc.

References m_channelMask, m_chMaskCntl, m_dataRate, m_nbRep, and m_txPower.

◆ Serialize()

void ns3::LinkAdrReq::Serialize ( Buffer::Iterator &  start) const
virtual

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::LorawanMacCommand.

Definition at line 295 of file lorawan-mac-command.cc.

References ns3::LorawanMacCommand::GetCIDFromLorawanMacCommand(), m_channelMask, m_chMaskCntl, ns3::LorawanMacCommand::m_commandType, m_dataRate, m_nbRep, and m_txPower.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_channelMask

uint16_t ns3::LinkAdrReq::m_channelMask
private

Definition at line 264 of file lorawan-mac-command.h.

Referenced by Deserialize(), GetEnabledChannelsList(), Print(), and Serialize().

◆ m_chMaskCntl

uint8_t ns3::LinkAdrReq::m_chMaskCntl
private

Definition at line 265 of file lorawan-mac-command.h.

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

◆ m_dataRate

uint8_t ns3::LinkAdrReq::m_dataRate
private

Definition at line 262 of file lorawan-mac-command.h.

Referenced by Deserialize(), GetDataRate(), Print(), and Serialize().

◆ m_nbRep

uint8_t ns3::LinkAdrReq::m_nbRep
private

Definition at line 266 of file lorawan-mac-command.h.

Referenced by Deserialize(), GetRepetitions(), Print(), and Serialize().

◆ m_txPower

uint8_t ns3::LinkAdrReq::m_txPower
private

Definition at line 263 of file lorawan-mac-command.h.

Referenced by Deserialize(), GetTxPower(), Print(), and Serialize().


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