ns3::LoraTag Class Reference

Tag used to save various data about a packet, like its Spreading Factor and data about interference. More...

#include "lora-tag.h"

+ Inheritance diagram for ns3::LoraTag:
+ Collaboration diagram for ns3::LoraTag:

Public Member Functions

 LoraTag (uint8_t sf=0, uint8_t destroyedBy=0)
 Create a LoraTag with a given spreading factor and collision. More...
 
virtual ~LoraTag ()
 
virtual void Deserialize (TagBuffer i)
 
uint8_t GetDataRate (void)
 Get the data rate for this packet. More...
 
uint8_t GetDestroyedBy () const
 Read which Spreading Factor this packet was destroyed by. More...
 
double GetFrequency (void)
 Get the frequency of the packet. More...
 
virtual TypeId GetInstanceTypeId (void) const
 
uint8_t GetModcod (void)
 Get the modcod for this packet. More...
 
double GetReceivePower () const
 Read the power this packet arrived with. More...
 
virtual uint32_t GetSerializedSize () const
 
uint8_t GetSpreadingFactor () const
 Read which Spreading Factor this packet was transmitted with. More...
 
virtual void Print (std::ostream &os) const
 
virtual void Serialize (TagBuffer i) const
 
void SetDataRate (uint8_t dataRate)
 Set the data rate for this packet. More...
 
void SetDestroyedBy (uint8_t sf)
 Set which Spreading Factor this packet was destroyed by. More...
 
void SetFrequency (double frequency)
 Set the frequency of the packet. More...
 
void SetModcod (uint8_t modcod)
 Set the modcod for this packet. More...
 
void SetReceivePower (double receivePower)
 Set the power this packet was received with. More...
 
void SetSpreadingFactor (uint8_t sf)
 Set which Spreading Factor this packet was transmitted with. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Private Attributes

uint8_t m_dataRate
 The Data Rate that needs to be used to send this. More...
 
uint8_t m_destroyedBy
 The Spreading Factor that destroyed the packet. More...
 
double m_frequency
 packet. More...
 
uint8_t m_modcod
 The Modcod ID used by the packet. More...
 
double m_receivePower
 The reception power of this packet. More...
 
uint8_t m_sf
 The Spreading Factor used by the packet. More...
 

Detailed Description

Tag used to save various data about a packet, like its Spreading Factor and data about interference.

Definition at line 37 of file lora-tag.h.

Constructor & Destructor Documentation

◆ LoraTag()

ns3::LoraTag::LoraTag ( uint8_t  sf = 0,
uint8_t  destroyedBy = 0 
)

Create a LoraTag with a given spreading factor and collision.

Parameters
sfThe Spreading Factor.
destroyedByThe SF this tag's packet was destroyed by.

Definition at line 46 of file lora-tag.cc.

◆ ~LoraTag()

ns3::LoraTag::~LoraTag ( )
virtual

Definition at line 56 of file lora-tag.cc.

Member Function Documentation

◆ Deserialize()

void ns3::LoraTag::Deserialize ( TagBuffer  i)
virtual

Definition at line 80 of file lora-tag.cc.

References m_dataRate, m_destroyedBy, m_frequency, m_modcod, m_receivePower, and m_sf.

◆ GetDataRate()

uint8_t ns3::LoraTag::GetDataRate ( void  )

Get the data rate for this packet.

Returns
The data rate that needs to be employed for this packet.

Definition at line 146 of file lora-tag.cc.

References m_dataRate.

Referenced by ns3::LorawanMacGateway::Send().

+ Here is the caller graph for this function:

◆ GetDestroyedBy()

uint8_t ns3::LoraTag::GetDestroyedBy ( ) const

Read which Spreading Factor this packet was destroyed by.

Returns
The SF this packet was destroyed by.

Definition at line 104 of file lora-tag.cc.

References m_destroyedBy.

◆ GetFrequency()

double ns3::LoraTag::GetFrequency ( void  )

Get the frequency of the packet.

Definition at line 140 of file lora-tag.cc.

References m_frequency.

Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket(), and ns3::LorawanMacGateway::Send().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::LoraTag::GetInstanceTypeId ( void  ) const
virtual

Definition at line 41 of file lora-tag.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetModcod()

uint8_t ns3::LoraTag::GetModcod ( void  )

Get the modcod for this packet.

Returns
The data modcod needs to be employed for this packet.

Definition at line 158 of file lora-tag.cc.

References m_modcod.

Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket(), and ns3::LorawanMacGateway::Send().

+ Here is the caller graph for this function:

◆ GetReceivePower()

double ns3::LoraTag::GetReceivePower ( ) const

Read the power this packet arrived with.

Returns
This tag's packet received power.

Definition at line 110 of file lora-tag.cc.

References m_receivePower.

Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::LoraTag::GetSerializedSize ( void  ) const
virtual

Definition at line 61 of file lora-tag.cc.

◆ GetSpreadingFactor()

uint8_t ns3::LoraTag::GetSpreadingFactor ( ) const

Read which Spreading Factor this packet was transmitted with.

Returns
This tag's packet's SF.

Definition at line 98 of file lora-tag.cc.

References m_sf.

Referenced by ns3::LoraEndDeviceStatus::InsertReceivedPacket().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::LoraTag::GetTypeId ( void  )
static

Definition at line 34 of file lora-tag.cc.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ Print()

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

Definition at line 91 of file lora-tag.cc.

References m_dataRate, m_destroyedBy, m_modcod, m_receivePower, and m_sf.

◆ Serialize()

void ns3::LoraTag::Serialize ( TagBuffer  i) const
virtual

Definition at line 69 of file lora-tag.cc.

References m_dataRate, m_destroyedBy, m_frequency, m_modcod, m_receivePower, and m_sf.

◆ SetDataRate()

void ns3::LoraTag::SetDataRate ( uint8_t  dataRate)

Set the data rate for this packet.

Parameters
dataRateThe data rate.

Definition at line 152 of file lora-tag.cc.

References m_dataRate.

Referenced by ns3::LoraNetworkStatus::GetReplyForDevice(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().

+ Here is the caller graph for this function:

◆ SetDestroyedBy()

void ns3::LoraTag::SetDestroyedBy ( uint8_t  sf)

Set which Spreading Factor this packet was destroyed by.

Parameters
sfThe Spreading Factor.

Definition at line 116 of file lora-tag.cc.

References m_destroyedBy.

◆ SetFrequency()

void ns3::LoraTag::SetFrequency ( double  frequency)

Set the frequency of the packet.

This value works in two ways:

  • It is used by the GW to signal to the NS the frequency of the uplink packet
  • It is used by the NS to signal to the GW the freqeuncy of a downlink packet

Definition at line 134 of file lora-tag.cc.

References m_frequency.

Referenced by ns3::LoraNetworkStatus::GetReplyForDevice(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().

+ Here is the caller graph for this function:

◆ SetModcod()

void ns3::LoraTag::SetModcod ( uint8_t  modcod)

Set the modcod for this packet.

Parameters
dataRateThe modcod.

Definition at line 164 of file lora-tag.cc.

References m_modcod.

Referenced by ns3::LoraNetworkStatus::GetReplyForDevice(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().

+ Here is the caller graph for this function:

◆ SetReceivePower()

void ns3::LoraTag::SetReceivePower ( double  receivePower)

Set the power this packet was received with.

Parameters
receivePowerThe power, in dBm.

Definition at line 128 of file lora-tag.cc.

References m_receivePower.

◆ SetSpreadingFactor()

void ns3::LoraTag::SetSpreadingFactor ( uint8_t  sf)

Set which Spreading Factor this packet was transmitted with.

Parameters
sfThe Spreading Factor.

Definition at line 122 of file lora-tag.cc.

References m_sf.

Member Data Documentation

◆ m_dataRate

uint8_t ns3::LoraTag::m_dataRate
private

The Data Rate that needs to be used to send this.

Definition at line 149 of file lora-tag.h.

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

◆ m_destroyedBy

uint8_t ns3::LoraTag::m_destroyedBy
private

The Spreading Factor that destroyed the packet.

Definition at line 147 of file lora-tag.h.

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

◆ m_frequency

double ns3::LoraTag::m_frequency
private

packet.

The frequency of this packet

Definition at line 151 of file lora-tag.h.

Referenced by Deserialize(), GetFrequency(), Serialize(), and SetFrequency().

◆ m_modcod

uint8_t ns3::LoraTag::m_modcod
private

The Modcod ID used by the packet.

Definition at line 146 of file lora-tag.h.

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

◆ m_receivePower

double ns3::LoraTag::m_receivePower
private

The reception power of this packet.

Definition at line 148 of file lora-tag.h.

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

◆ m_sf

uint8_t ns3::LoraTag::m_sf
private

The Spreading Factor used by the packet.

Definition at line 145 of file lora-tag.h.

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


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