ns3::DevStatusAns Class Reference

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

#include "lorawan-mac-command.h"

+ Inheritance diagram for ns3::DevStatusAns:
+ Collaboration diagram for ns3::DevStatusAns:

Public Member Functions

 DevStatusAns ()
 
 DevStatusAns (uint8_t battery, uint8_t margin)
 Constructor with initialization of all parameters. More...
 
virtual uint8_t Deserialize (Buffer::Iterator &start)
 Deserialize the buffer into a MAC command. More...
 
uint8_t GetBattery (void)
 Get the battery information contained in this MAC command. More...
 
uint8_t GetMargin (void)
 Get the demodulation margin contained in 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

uint8_t m_battery
 
uint8_t m_margin
 

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

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

Constructor & Destructor Documentation

◆ DevStatusAns() [1/2]

ns3::DevStatusAns::DevStatusAns ( )

◆ DevStatusAns() [2/2]

ns3::DevStatusAns::DevStatusAns ( uint8_t  battery,
uint8_t  margin 
)

Constructor with initialization of all parameters.

Parameters
batteryThe battery level in [0, 255].
marginThe demodulation margin of the last received DevStatusReq packet.

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

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

Member Function Documentation

◆ Deserialize()

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

References m_battery, m_margin, and ns3::LorawanMacCommand::m_serializedSize.

◆ GetBattery()

uint8_t ns3::DevStatusAns::GetBattery ( void  )

Get the battery information contained in this MAC command.

Returns
The battery level.

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

References m_battery.

◆ GetMargin()

uint8_t ns3::DevStatusAns::GetMargin ( void  )

Get the demodulation margin contained in this MAC command.

Returns
The margin.

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

References m_margin.

◆ Print()

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

References m_battery, and m_margin.

◆ Serialize()

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

References ns3::LorawanMacCommand::GetCIDFromLorawanMacCommand(), m_battery, ns3::LorawanMacCommand::m_commandType, and m_margin.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_battery

uint8_t ns3::DevStatusAns::m_battery
private

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

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

◆ m_margin

uint8_t ns3::DevStatusAns::m_margin
private

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

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


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