ns3::LoraEndDeviceStatus Class Reference

This class represents the Network Server's knowledge about an End Device in the LoRaWAN network it is administering. More...

#include "lora-end-device-status.h"

+ Inheritance diagram for ns3::LoraEndDeviceStatus:
+ Collaboration diagram for ns3::LoraEndDeviceStatus:

Classes

struct  PacketInfoPerGw
 Structure saving information regarding the packet reception in each gateway. More...
 
struct  ReceivedPacketInfo
 Structure saving information regarding all packet receptions. More...
 
struct  Reply
 Structure representing the reply that the network server will send this device at the first opportunity. More...
 

Public Types

typedef std::map< Address, PacketInfoPerGwGatewayList
 
typedef std::list< std::pair< Ptr< const Packet >, ReceivedPacketInfo > > ReceivedPacketList
 

Public Member Functions

 LoraEndDeviceStatus ()
 
 LoraEndDeviceStatus (LoraDeviceAddress endDeviceAddress, Ptr< LorawanMacEndDeviceClassA > endDeviceMac)
 
virtual ~LoraEndDeviceStatus ()
 
void AddMACCommand (Ptr< LorawanMacCommand > macCommand)
 Add MAC command to the list. More...
 
uint8_t GetBeamId (void)
 Get the beam ID this device is using. More...
 
Ptr< Packet > GetCompleteReplyPacket (void)
 Get the reply packet. More...
 
double GetFirstReceiveWindowFrequency (void)
 Get the first window frequency of this device. More...
 
uint8_t GetFirstReceiveWindowSpreadingFactor (void)
 Get the spreading factor this device is using in the first receive window. More...
 
Ptr< const Packet > GetLastPacketReceivedFromDevice (void)
 Return the last packet that was received from this device. More...
 
LoraEndDeviceStatus::ReceivedPacketInfo GetLastReceivedPacketInfo (void)
 Return the information about the last packet that was received from the device. More...
 
Ptr< LorawanMacEndDeviceClassAGetMac (void)
 
uint8_t GetModcod (void)
 Get the modcod this device is using. More...
 
std::map< double, Address > GetPowerGatewayMap (void)
 Return an ordered list of the best gateways. More...
 
ReceivedPacketList GetReceivedPacketList (void)
 Get the received packet list. More...
 
LoraFrameHeader GetReplyFrameHeader (void)
 Get the reply packet frame header. More...
 
LorawanMacHeader GetReplyMacHeader (void)
 Get the reply packet mac header. More...
 
Ptr< Packet > GetReplyPayload (void)
 Get the data of the reply packet. More...
 
double GetSecondReceiveWindowFrequency (void)
 Return the second window frequency of this device. More...
 
uint8_t GetSecondReceiveWindowOffset (void)
 Get the offset of spreading factor this device is using in the second receive window with respect to the first receive window. More...
 
bool HasReceiveWindowOpportunityScheduled ()
 Returns whether we already decided we will schedule a transmission to this ED. More...
 
void InitializeReply (void)
 Initialize reply. More...
 
void InsertReceivedPacket (Ptr< const Packet > receivedPacket, const Address &gwAddress)
 Insert a received packet in the packet list. More...
 
bool NeedsReply (void)
 Whether the end device needs a reply. More...
 
void RemoveReceiveWindowOpportunity (void)
 
void SetBeamId (uint8_t beamId)
 Set the beam ID this device is using. More...
 
void SetFirstReceiveWindowFrequency (double frequency)
 Set the first window frequency of this device. More...
 
void SetFirstReceiveWindowSpreadingFactor (uint8_t sf)
 Set the spreading factor this device is using in the first receive window. More...
 
void SetModcod (uint8_t modcod)
 Set the modcod this device is using. More...
 
void SetReceiveWindowOpportunity (EventId event)
 
void SetReplyFrameHeader (LoraFrameHeader frameHeader)
 Set the reply packet frame header. More...
 
void SetReplyMacHeader (LorawanMacHeader macHeader)
 Set the reply packet mac header. More...
 
void SetReplyPayload (Ptr< Packet > replyPayload)
 Set the packet reply payload. More...
 
void SetSecondReceiveWindowFrequency (double frequency)
 Set the second window frequency of this device. More...
 
void SetSecondReceiveWindowOffset (uint8_t offset)
 Set the spreading factor this device is using in the first receive window. More...
 
void UpdateGatewayData (GatewayList gwList, Address gwAddress, double rcvPower)
 Update Gateway data when more then one gateway receive the same packet. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Public Attributes

LoraDeviceAddress m_endDeviceAddress
 
struct Reply m_reply
 

Private Attributes

uint8_t m_beamId
 
double m_firstReceiveWindowFrequency = 0
 
uint8_t m_firstReceiveWindowSpreadingFactor = 0
 
Ptr< LorawanMacEndDeviceClassAm_mac
 Pointer to the MAC layer of this device. More...
 
uint8_t m_modcod
 
ReceivedPacketList m_receivedPacketList
 
EventId m_receiveWindowEvent
 
double m_secondReceiveWindowFrequency = 869.525
 
uint8_t m_secondReceiveWindowOffset = 0
 

Friends

std::ostream & operator<< (std::ostream &os, const LoraEndDeviceStatus &status)
 

Detailed Description

This class represents the Network Server's knowledge about an End Device in the LoRaWAN network it is administering.

The Network Server's NetworkStatus component contains a list of instances of this class, one for each device in the network. Each instance contains all the parameters and information of the end device and the packets received from it. Furthermore, this class holds the reply packet that the network server will send to this device at the first available receive window. Upon new packet arrivals at the Network Server, the OnReceivedPacket method is called to update the information regarding the last received packet and its parameters.

Definition at line 85 of file lora-end-device-status.h.

Member Typedef Documentation

◆ GatewayList

Definition at line 165 of file lora-end-device-status.h.

◆ ReceivedPacketList

typedef std::list<std::pair<Ptr<const Packet>, ReceivedPacketInfo> > ns3::LoraEndDeviceStatus::ReceivedPacketList

Definition at line 179 of file lora-end-device-status.h.

Constructor & Destructor Documentation

◆ LoraEndDeviceStatus() [1/2]

ns3::LoraEndDeviceStatus::LoraEndDeviceStatus ( )

Definition at line 63 of file lora-end-device-status.cc.

References m_receivedPacketList, and m_reply.

◆ LoraEndDeviceStatus() [2/2]

ns3::LoraEndDeviceStatus::LoraEndDeviceStatus ( LoraDeviceAddress  endDeviceAddress,
Ptr< LorawanMacEndDeviceClassA endDeviceMac 
)

Definition at line 53 of file lora-end-device-status.cc.

◆ ~LoraEndDeviceStatus()

ns3::LoraEndDeviceStatus::~LoraEndDeviceStatus ( )
virtual

Definition at line 72 of file lora-end-device-status.cc.

Member Function Documentation

◆ AddMACCommand()

void ns3::LoraEndDeviceStatus::AddMACCommand ( Ptr< LorawanMacCommand macCommand)

Add MAC command to the list.

Definition at line 402 of file lora-end-device-status.cc.

References ns3::LoraFrameHeader::AddCommand(), ns3::LoraEndDeviceStatus::Reply::frameHeader, and m_reply.

+ Here is the call graph for this function:

◆ GetBeamId()

uint8_t ns3::LoraEndDeviceStatus::GetBeamId ( void  )

Get the beam ID this device is using.

Returns
An unsigned 8-bit integer containing the beam ID index.

Definition at line 89 of file lora-end-device-status.cc.

References m_beamId.

◆ GetCompleteReplyPacket()

◆ GetFirstReceiveWindowFrequency()

double ns3::LoraEndDeviceStatus::GetFirstReceiveWindowFrequency ( void  )

Get the first window frequency of this device.

Definition at line 104 of file lora-end-device-status.cc.

References m_firstReceiveWindowFrequency.

◆ GetFirstReceiveWindowSpreadingFactor()

uint8_t ns3::LoraEndDeviceStatus::GetFirstReceiveWindowSpreadingFactor ( void  )

Get the spreading factor this device is using in the first receive window.

Returns
An unsigned 8-bit integer containing the spreading factor.

Definition at line 96 of file lora-end-device-status.cc.

References m_firstReceiveWindowSpreadingFactor.

◆ GetLastPacketReceivedFromDevice()

Ptr< const Packet > ns3::LoraEndDeviceStatus::GetLastPacketReceivedFromDevice ( void  )

Return the last packet that was received from this device.

Definition at line 379 of file lora-end-device-status.cc.

References m_receivedPacketList.

Referenced by GetCompleteReplyPacket().

+ Here is the caller graph for this function:

◆ GetLastReceivedPacketInfo()

LoraEndDeviceStatus::ReceivedPacketInfo ns3::LoraEndDeviceStatus::GetLastReceivedPacketInfo ( void  )

Return the information about the last packet that was received from the device.

Definition at line 364 of file lora-end-device-status.cc.

References m_receivedPacketList.

Referenced by GetCompleteReplyPacket().

+ Here is the caller graph for this function:

◆ GetMac()

Ptr< LorawanMacEndDeviceClassA > ns3::LoraEndDeviceStatus::GetMac ( void  )

Definition at line 194 of file lora-end-device-status.cc.

References m_mac.

◆ GetModcod()

uint8_t ns3::LoraEndDeviceStatus::GetModcod ( void  )

Get the modcod this device is using.

Returns
An unsigned 8-bit integer containing the modcod index.

Definition at line 82 of file lora-end-device-status.cc.

References m_modcod.

◆ GetPowerGatewayMap()

std::map< double, Address > ns3::LoraEndDeviceStatus::GetPowerGatewayMap ( void  )

Return an ordered list of the best gateways.

Definition at line 426 of file lora-end-device-status.cc.

References ns3::LoraEndDeviceStatus::ReceivedPacketInfo::gwList, and m_receivedPacketList.

◆ GetReceivedPacketList()

LoraEndDeviceStatus::ReceivedPacketList ns3::LoraEndDeviceStatus::GetReceivedPacketList ( void  )

Get the received packet list.

Returns
The received packet list.

Definition at line 200 of file lora-end-device-status.cc.

References m_receivedPacketList.

◆ GetReplyFrameHeader()

LoraFrameHeader ns3::LoraEndDeviceStatus::GetReplyFrameHeader ( void  )

Get the reply packet frame header.

Returns
The packet reply frame header.

Definition at line 180 of file lora-end-device-status.cc.

References ns3::LoraEndDeviceStatus::Reply::frameHeader, and m_reply.

◆ GetReplyMacHeader()

LorawanMacHeader ns3::LoraEndDeviceStatus::GetReplyMacHeader ( void  )

Get the reply packet mac header.

Returns
The packet reply mac header.

Definition at line 173 of file lora-end-device-status.cc.

References m_reply, and ns3::LoraEndDeviceStatus::Reply::macHeader.

◆ GetReplyPayload()

Ptr< Packet > ns3::LoraEndDeviceStatus::GetReplyPayload ( void  )

Get the data of the reply packet.

Returns
A pointer to the packet reply.

Definition at line 187 of file lora-end-device-status.cc.

References m_reply, and ns3::LoraEndDeviceStatus::Reply::payload.

◆ GetSecondReceiveWindowFrequency()

double ns3::LoraEndDeviceStatus::GetSecondReceiveWindowFrequency ( void  )

Return the second window frequency of this device.

Definition at line 120 of file lora-end-device-status.cc.

References m_secondReceiveWindowFrequency.

◆ GetSecondReceiveWindowOffset()

uint8_t ns3::LoraEndDeviceStatus::GetSecondReceiveWindowOffset ( void  )

Get the offset of spreading factor this device is using in the second receive window with respect to the first receive window.

Returns
An unsigned 8-bit integer containing the spreading factor.

Definition at line 112 of file lora-end-device-status.cc.

References m_secondReceiveWindowOffset.

◆ GetTypeId()

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

Definition at line 45 of file lora-end-device-status.cc.

◆ HasReceiveWindowOpportunityScheduled()

bool ns3::LoraEndDeviceStatus::HasReceiveWindowOpportunityScheduled ( )

Returns whether we already decided we will schedule a transmission to this ED.

Definition at line 408 of file lora-end-device-status.cc.

References m_receiveWindowEvent.

◆ InitializeReply()

void ns3::LoraEndDeviceStatus::InitializeReply ( void  )

Initialize reply.

Definition at line 394 of file lora-end-device-status.cc.

References m_reply, and ns3::LoraEndDeviceStatus::Reply::needsReply.

◆ InsertReceivedPacket()

◆ NeedsReply()

bool ns3::LoraEndDeviceStatus::NeedsReply ( void  )

Whether the end device needs a reply.

This is determined by looking at headers and payload of the Reply structure: if they are empty, no reply should be needed.

Returns
A boolean value signaling if the end device needs a reply.

Definition at line 165 of file lora-end-device-status.cc.

References m_reply, and ns3::LoraEndDeviceStatus::Reply::needsReply.

◆ RemoveReceiveWindowOpportunity()

void ns3::LoraEndDeviceStatus::RemoveReceiveWindowOpportunity ( void  )

Definition at line 420 of file lora-end-device-status.cc.

References m_receiveWindowEvent.

◆ SetBeamId()

void ns3::LoraEndDeviceStatus::SetBeamId ( uint8_t  beamId)

Set the beam ID this device is using.

Definition at line 214 of file lora-end-device-status.cc.

References m_beamId.

Referenced by InsertReceivedPacket().

+ Here is the caller graph for this function:

◆ SetFirstReceiveWindowFrequency()

void ns3::LoraEndDeviceStatus::SetFirstReceiveWindowFrequency ( double  frequency)

Set the first window frequency of this device.

Definition at line 228 of file lora-end-device-status.cc.

References m_firstReceiveWindowFrequency.

Referenced by InsertReceivedPacket().

+ Here is the caller graph for this function:

◆ SetFirstReceiveWindowSpreadingFactor()

void ns3::LoraEndDeviceStatus::SetFirstReceiveWindowSpreadingFactor ( uint8_t  sf)

Set the spreading factor this device is using in the first receive window.

Definition at line 221 of file lora-end-device-status.cc.

References m_firstReceiveWindowSpreadingFactor.

Referenced by InsertReceivedPacket().

+ Here is the caller graph for this function:

◆ SetModcod()

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

Set the modcod this device is using.

Definition at line 207 of file lora-end-device-status.cc.

References m_modcod.

Referenced by InsertReceivedPacket().

+ Here is the caller graph for this function:

◆ SetReceiveWindowOpportunity()

void ns3::LoraEndDeviceStatus::SetReceiveWindowOpportunity ( EventId  event)

Definition at line 414 of file lora-end-device-status.cc.

References m_receiveWindowEvent.

◆ SetReplyFrameHeader()

void ns3::LoraEndDeviceStatus::SetReplyFrameHeader ( LoraFrameHeader  frameHeader)

Set the reply packet frame header.

Definition at line 256 of file lora-end-device-status.cc.

References ns3::LoraEndDeviceStatus::Reply::frameHeader, and m_reply.

◆ SetReplyMacHeader()

void ns3::LoraEndDeviceStatus::SetReplyMacHeader ( LorawanMacHeader  macHeader)

Set the reply packet mac header.

Definition at line 249 of file lora-end-device-status.cc.

References m_reply, and ns3::LoraEndDeviceStatus::Reply::macHeader.

◆ SetReplyPayload()

void ns3::LoraEndDeviceStatus::SetReplyPayload ( Ptr< Packet >  replyPayload)

Set the packet reply payload.

Definition at line 263 of file lora-end-device-status.cc.

References m_reply, and ns3::LoraEndDeviceStatus::Reply::payload.

◆ SetSecondReceiveWindowFrequency()

void ns3::LoraEndDeviceStatus::SetSecondReceiveWindowFrequency ( double  frequency)

Set the second window frequency of this device.

Definition at line 242 of file lora-end-device-status.cc.

References m_secondReceiveWindowFrequency.

◆ SetSecondReceiveWindowOffset()

void ns3::LoraEndDeviceStatus::SetSecondReceiveWindowOffset ( uint8_t  offset)

Set the spreading factor this device is using in the first receive window.

Definition at line 235 of file lora-end-device-status.cc.

References m_secondReceiveWindowOffset.

◆ UpdateGatewayData()

void ns3::LoraEndDeviceStatus::UpdateGatewayData ( GatewayList  gwList,
Address  gwAddress,
double  rcvPower 
)

Update Gateway data when more then one gateway receive the same packet.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const LoraEndDeviceStatus status 
)
friend

Definition at line 446 of file lora-end-device-status.cc.

Member Data Documentation

◆ m_beamId

uint8_t ns3::LoraEndDeviceStatus::m_beamId
private

Definition at line 344 of file lora-end-device-status.h.

Referenced by GetBeamId(), and SetBeamId().

◆ m_endDeviceAddress

LoraDeviceAddress ns3::LoraEndDeviceStatus::m_endDeviceAddress

Definition at line 337 of file lora-end-device-status.h.

Referenced by GetCompleteReplyPacket().

◆ m_firstReceiveWindowFrequency

double ns3::LoraEndDeviceStatus::m_firstReceiveWindowFrequency = 0
private

◆ m_firstReceiveWindowSpreadingFactor

uint8_t ns3::LoraEndDeviceStatus::m_firstReceiveWindowSpreadingFactor = 0
private

◆ m_mac

Ptr<LorawanMacEndDeviceClassA> ns3::LoraEndDeviceStatus::m_mac
private

Pointer to the MAC layer of this device.

Definition at line 355 of file lora-end-device-status.h.

Referenced by GetMac().

◆ m_modcod

uint8_t ns3::LoraEndDeviceStatus::m_modcod
private

Definition at line 343 of file lora-end-device-status.h.

Referenced by GetModcod(), and SetModcod().

◆ m_receivedPacketList

◆ m_receiveWindowEvent

EventId ns3::LoraEndDeviceStatus::m_receiveWindowEvent
private

◆ m_reply

◆ m_secondReceiveWindowFrequency

double ns3::LoraEndDeviceStatus::m_secondReceiveWindowFrequency = 869.525
private

◆ m_secondReceiveWindowOffset

uint8_t ns3::LoraEndDeviceStatus::m_secondReceiveWindowOffset = 0
private

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