Loading...
Searching...
No Matches
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.
uint8_t GetDataRate (void)
 Return the data rate prescribed by this MAC command.
std::list< int > GetEnabledChannelsList (void)
 Get the list of enabled channels.
int GetRepetitions (void)
 Get the number of repetitions prescribed by this MAC command.
uint8_t GetTxPower (void)
 Get the transmission power prescribed by this MAC command.
virtual void Print (std::ostream &os) const
 Print the contents of this MAC command in human-readable format.
virtual void Serialize (Buffer::Iterator &start) const
 Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
Public Member Functions inherited from ns3::LorawanMacCommand
 LorawanMacCommand ()
virtual ~LorawanMacCommand ()
virtual enum MacCommandType GetCommandType (void) const
 Get the commandType of this MAC command.
virtual uint8_t GetSerializedSize (void) const
 Get serialized length of this MAC command.

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.
static TypeId GetTypeId (void)
Protected Attributes inherited from ns3::LorawanMacCommand
enum MacCommandType m_commandType
 The type of this command.
uint8_t m_serializedSize
 This MAC command's serialized size.

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 217 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 310 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 341 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 357 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 375 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 349 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 328 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 298 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

◆ m_chMaskCntl

uint8_t ns3::LinkAdrReq::m_chMaskCntl
private

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

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

◆ m_dataRate

uint8_t ns3::LinkAdrReq::m_dataRate
private

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

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

◆ m_nbRep

uint8_t ns3::LinkAdrReq::m_nbRep
private

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

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

◆ m_txPower

uint8_t ns3::LinkAdrReq::m_txPower
private

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

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


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