ns3::DutyCycleReq Class Reference

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

#include "lorawan-mac-command.h"

+ Inheritance diagram for ns3::DutyCycleReq:
+ Collaboration diagram for ns3::DutyCycleReq:

Public Member Functions

 DutyCycleReq ()
 
 DutyCycleReq (uint8_t dutyCycle)
 Constructor providing initialization of all parameters. More...
 
virtual uint8_t Deserialize (Buffer::Iterator &start)
 Deserialize the buffer into a MAC command. More...
 
double GetMaximumAllowedDutyCycle (void) const
 Get the maximum duty cycle prescribed by this Mac command, in fraction form. 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

uint8_t m_maxDCycle
 

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 DutyCycleReq LoRaWAN MAC command.

With this command, the network server can limit the maximum aggregated transmit duty cycle of an end device. The aggregate duty cycle is computed as the duty cycle among all sub bands.

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

Constructor & Destructor Documentation

◆ DutyCycleReq() [1/2]

ns3::DutyCycleReq::DutyCycleReq ( )

◆ DutyCycleReq() [2/2]

ns3::DutyCycleReq::DutyCycleReq ( uint8_t  dutyCycle)

Constructor providing initialization of all parameters.

Parameters
dutyCycleThe duty cycle as a 8-bit unsigned integer.

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

References ns3::DUTY_CYCLE_REQ, ns3::LorawanMacCommand::m_commandType, and ns3::LorawanMacCommand::m_serializedSize.

Member Function Documentation

◆ Deserialize()

uint8_t ns3::DutyCycleReq::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 472 of file lorawan-mac-command.cc.

References m_maxDCycle, and ns3::LorawanMacCommand::m_serializedSize.

◆ GetMaximumAllowedDutyCycle()

double ns3::DutyCycleReq::GetMaximumAllowedDutyCycle ( void  ) const

Get the maximum duty cycle prescribed by this Mac command, in fraction form.

Returns
The maximum duty cycle.

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

References m_maxDCycle.

Referenced by Print().

+ Here is the caller graph for this function:

◆ Print()

void ns3::DutyCycleReq::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 484 of file lorawan-mac-command.cc.

References GetMaximumAllowedDutyCycle(), and m_maxDCycle.

+ Here is the call graph for this function:

◆ Serialize()

void ns3::DutyCycleReq::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 462 of file lorawan-mac-command.cc.

References ns3::LorawanMacCommand::GetCIDFromLorawanMacCommand(), ns3::LorawanMacCommand::m_commandType, and m_maxDCycle.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_maxDCycle

uint8_t ns3::DutyCycleReq::m_maxDCycle
private

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

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


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