A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lorawan::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::lorawan::LoraTag:
+ Collaboration diagram for ns3::lorawan::LoraTag:

Public Member Functions

 LoraTag (uint8_t sf=0, uint8_t destroyedBy=0)
 Create a LoraTag with a given spreading factor and collision.
 
 ~LoraTag () override
 Destructor.
 
void Deserialize (TagBuffer i) override
 
uint8_t GetDataRate () const
 Get the data rate for this packet.
 
uint8_t GetDestroyedBy () const
 Read which Spreading Factor this packet was destroyed by.
 
uint32_t GetFrequency () const
 Get the frequency of the packet.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
double GetReceivePower () const
 Read the power this packet arrived with.
 
uint32_t GetSerializedSize () const override
 
uint8_t GetSpreadingFactor () const
 Read which Spreading Factor this packet was transmitted with.
 
void Print (std::ostream &os) const override
 
void Serialize (TagBuffer i) const override
 
void SetDataRate (uint8_t dataRate)
 Set the data rate for this packet.
 
void SetDestroyedBy (uint8_t sf)
 Set which Spreading Factor this packet was destroyed by.
 
void SetFrequency (uint32_t frequencyHz)
 Set the frequency of the packet.
 
void SetReceivePower (double receivePower)
 Set the power this packet was received with.
 
void SetSpreadingFactor (uint8_t sf)
 Set which Spreading Factor this packet was transmitted with.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::Tag
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Attributes

uint8_t m_dataRate
 The data rate that needs to be used to send this packet.
 
uint8_t m_destroyedBy
 The Spreading Factor that destroyed the packet.
 
uint32_t m_frequencyHz
 The frequency [Hz] of this packet.
 
double m_receivePower
 The reception power of this packet.
 
uint8_t m_sf
 The Spreading Factor used by the packet.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ LoraTag()

ns3::lorawan::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 spreading factor this tag's packet was destroyed by.

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

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

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ ~LoraTag()

ns3::lorawan::LoraTag::~LoraTag ( )
override

Destructor.

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

Member Function Documentation

◆ Deserialize()

void ns3::lorawan::LoraTag::Deserialize ( TagBuffer i)
overridevirtual
Parameters
ithe buffer to read data from.

Read the content of the tag from the provided tag buffer. DO NOT attempt to read more bytes than you wrote with Tag::Serialize.

Implements ns3::Tag.

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

References m_dataRate, m_destroyedBy, m_frequencyHz, m_receivePower, m_sf, ns3::TagBuffer::ReadDouble(), ns3::TagBuffer::ReadU32(), and ns3::TagBuffer::ReadU8().

+ Here is the call graph for this function:

◆ GetDataRate()

uint8_t ns3::lorawan::LoraTag::GetDataRate ( ) const

Get the data rate for this packet.

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

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

References m_dataRate.

Referenced by ns3::lorawan::GatewayLorawanMac::Send().

+ Here is the caller graph for this function:

◆ GetDestroyedBy()

uint8_t ns3::lorawan::LoraTag::GetDestroyedBy ( ) const

Read which Spreading Factor this packet was destroyed by.

Returns
The spreading factor this packet was destroyed by.

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

References m_destroyedBy.

◆ GetFrequency()

uint32_t ns3::lorawan::LoraTag::GetFrequency ( ) const

Get the frequency of the packet.

This value works in two ways:

  • It is used by the gateway to signal to the network server the frequency of the uplink packet
  • It is used by the network server to signal to the gateway the frequency of a downlink packet.
Returns
The frequency value [Hz].

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

References m_frequencyHz.

Referenced by ns3::lorawan::EndDeviceStatus::InsertReceivedPacket(), and ns3::lorawan::GatewayLorawanMac::Send().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::lorawan::LoraTag::GetInstanceTypeId ( ) const
overridevirtual

Get the most derived TypeId for this Object.

This method is provided by ns3::Object::GetInstanceTypeId but classes which derive from ns3::ObjectBase directly have to implement it themselves. Typically, this method should simply return the output of GetTypeId().

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

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

References GetTypeId().

+ Here is the call graph for this function:

◆ GetReceivePower()

double ns3::lorawan::LoraTag::GetReceivePower ( ) const

Read the power this packet arrived with.

Returns
This tag's packet received power.

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

References m_receivePower.

Referenced by ns3::lorawan::EndDeviceStatus::InsertReceivedPacket(), and ns3::lorawan::ClassAEndDeviceLorawanMac::Receive().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::lorawan::LoraTag::GetSerializedSize ( ) const
overridevirtual
Returns
the number of bytes required to serialize the data of the tag.

This method is typically invoked by Packet::AddPacketTag or Packet::AddByteTag just prior to calling Tag::Serialize.

Implements ns3::Tag.

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

◆ GetSpreadingFactor()

uint8_t ns3::lorawan::LoraTag::GetSpreadingFactor ( ) const

Read which Spreading Factor this packet was transmitted with.

Returns
This tag's packet's spreading factor.

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

References m_sf.

Referenced by ns3::lorawan::EndDeviceStatus::InsertReceivedPacket(), OnPacketReceptionCallback(), and OnTransmissionCallback().

+ Here is the caller graph for this function:

◆ GetTypeId()

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

Register this type.

Returns
The object TypeId.

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

References LoraTag(), and ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Print()

void ns3::lorawan::LoraTag::Print ( std::ostream & os) const
overridevirtual
Parameters
osthe stream to print to

This method is typically invoked from the Packet::PrintByteTags or Packet::PrintPacketTags methods.

Implements ns3::Tag.

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

References m_dataRate, m_destroyedBy, m_receivePower, and m_sf.

◆ Serialize()

void ns3::lorawan::LoraTag::Serialize ( TagBuffer i) const
overridevirtual
Parameters
ithe buffer to write data into.

Write the content of the tag in the provided tag buffer. DO NOT attempt to write more bytes than you requested with Tag::GetSerializedSize.

Implements ns3::Tag.

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

References m_dataRate, m_destroyedBy, m_frequencyHz, m_receivePower, m_sf, ns3::TagBuffer::WriteDouble(), ns3::TagBuffer::WriteU32(), and ns3::TagBuffer::WriteU8().

+ Here is the call graph for this function:

◆ SetDataRate()

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

Set the data rate for this packet.

Parameters
dataRateThe data rate.

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

References m_dataRate.

Referenced by ns3::lorawan::NetworkStatus::GetReplyForDevice().

+ Here is the caller graph for this function:

◆ SetDestroyedBy()

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

Set which Spreading Factor this packet was destroyed by.

Parameters
sfThe Spreading Factor.

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

References m_destroyedBy.

Referenced by ns3::lorawan::SimpleGatewayLoraPhy::EndReceive().

+ Here is the caller graph for this function:

◆ SetFrequency()

void ns3::lorawan::LoraTag::SetFrequency ( uint32_t frequencyHz)

Set the frequency of the packet.

This value works in two ways:

  • It is used by the gateway to signal to the network server the frequency of the uplink packet
  • It is used by the network server to signal to the gateway the frequency of a downlink packet.
Parameters
frequencyHzThe frequency value [Hz].

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

References m_frequencyHz.

Referenced by ns3::lorawan::SimpleEndDeviceLoraPhy::EndReceive(), ns3::lorawan::SimpleGatewayLoraPhy::EndReceive(), and ns3::lorawan::NetworkStatus::GetReplyForDevice().

+ Here is the caller graph for this function:

◆ SetReceivePower()

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

Set the power this packet was received with.

Parameters
receivePowerThe power, in dBm.

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

References m_receivePower.

Referenced by ns3::lorawan::SimpleEndDeviceLoraPhy::EndReceive(), and ns3::lorawan::SimpleGatewayLoraPhy::EndReceive().

+ Here is the caller graph for this function:

◆ SetSpreadingFactor()

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

Set which Spreading Factor this packet was transmitted with.

Parameters
sfThe Spreading Factor.

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

References m_sf.

Referenced by ns3::lorawan::SimpleEndDeviceLoraPhy::Send().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_dataRate

uint8_t ns3::lorawan::LoraTag::m_dataRate
private

The data rate that needs to be used to send this packet.

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

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

◆ m_destroyedBy

uint8_t ns3::lorawan::LoraTag::m_destroyedBy
private

The Spreading Factor that destroyed the packet.

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

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

◆ m_frequencyHz

uint32_t ns3::lorawan::LoraTag::m_frequencyHz
private

The frequency [Hz] of this packet.

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

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

◆ m_receivePower

double ns3::lorawan::LoraTag::m_receivePower
private

The reception power of this packet.

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

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

◆ m_sf

uint8_t ns3::lorawan::LoraTag::m_sf
private

The Spreading Factor used by the packet.

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

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


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