ns3::LoraNetworkStatus Class Reference

This class represents the knowledge about the state of the network that is available at the Network Server. More...

#include "lora-network-status.h"

+ Inheritance diagram for ns3::LoraNetworkStatus:
+ Collaboration diagram for ns3::LoraNetworkStatus:

Public Member Functions

 LoraNetworkStatus ()
 
virtual ~LoraNetworkStatus ()
 
void AddGateway (Address &address, Ptr< LoraGatewayStatus > gwStatus)
 Add this gateway to the list of gateways connected to the network. More...
 
void AddNode (Ptr< LorawanMacEndDeviceClassA > edMac)
 Add a device to the ones that are tracked by this LoraNetworkStatus object. More...
 
int CountEndDevices (void)
 Return the number of end devices currently managed by the server. More...
 
Address GetBestGatewayForDevice (LoraDeviceAddress deviceAddress, int window)
 Return whether we have a gateway that is available to send a reply to the specified device. More...
 
Ptr< LoraEndDeviceStatusGetEndDeviceStatus (LoraDeviceAddress address)
 Get the EndDeviceStatus corresponding to a LoraDeviceAddress. More...
 
Ptr< LoraEndDeviceStatusGetEndDeviceStatus (Ptr< const Packet > packet)
 Get the EndDeviceStatus for the device that sent a packet. More...
 
Ptr< Packet > GetReplyForDevice (LoraDeviceAddress edAddress, int windowNumber)
 Get the reply for the specified device address. More...
 
bool NeedsReply (LoraDeviceAddress deviceAddress)
 Return whether the specified device needs a reply. More...
 
void OnReceivedPacket (Ptr< const Packet > packet, const Address &gwaddress)
 Update network status on the received packet. More...
 
void SendThroughGateway (Ptr< Packet > packet, Address gwAddress)
 Send a packet through a Gateway. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Public Attributes

std::map< LoraDeviceAddress, Ptr< LoraEndDeviceStatus > > m_endDeviceStatuses
 
std::map< Address, Ptr< LoraGatewayStatus > > m_gatewayStatuses
 

Detailed Description

This class represents the knowledge about the state of the network that is available at the Network Server.

It is essentially a collection of two maps: one containing DeviceStatus objects, and the other containing GatewayStatus objects.

This class is meant to be queried by NetworkController components, which can decide to take action based on the current status of the network.

Definition at line 47 of file lora-network-status.h.

Constructor & Destructor Documentation

◆ LoraNetworkStatus()

ns3::LoraNetworkStatus::LoraNetworkStatus ( )

Definition at line 51 of file lora-network-status.cc.

◆ ~LoraNetworkStatus()

ns3::LoraNetworkStatus::~LoraNetworkStatus ( )
virtual

Definition at line 56 of file lora-network-status.cc.

Member Function Documentation

◆ AddGateway()

void ns3::LoraNetworkStatus::AddGateway ( Address &  address,
Ptr< LoraGatewayStatus gwStatus 
)

Add this gateway to the list of gateways connected to the network.

Each GW is identified by its Address in the NS-GW network.

Definition at line 83 of file lora-network-status.cc.

References m_gatewayStatuses.

◆ AddNode()

void ns3::LoraNetworkStatus::AddNode ( Ptr< LorawanMacEndDeviceClassA edMac)

Add a device to the ones that are tracked by this LoraNetworkStatus object.

Definition at line 62 of file lora-network-status.cc.

References m_endDeviceStatuses, and ns3::LoraDeviceAddress::Print().

+ Here is the call graph for this function:

◆ CountEndDevices()

int ns3::LoraNetworkStatus::CountEndDevices ( void  )

Return the number of end devices currently managed by the server.

Definition at line 251 of file lora-network-status.cc.

References m_endDeviceStatuses.

◆ GetBestGatewayForDevice()

Address ns3::LoraNetworkStatus::GetBestGatewayForDevice ( LoraDeviceAddress  deviceAddress,
int  window 
)

Return whether we have a gateway that is available to send a reply to the specified device.

Parameters
deviceAddressthe address of the device we are interested in.

Definition at line 127 of file lora-network-status.cc.

References m_endDeviceStatuses, and m_gatewayStatuses.

◆ GetEndDeviceStatus() [1/2]

Ptr< LoraEndDeviceStatus > ns3::LoraNetworkStatus::GetEndDeviceStatus ( LoraDeviceAddress  address)

Get the EndDeviceStatus corresponding to a LoraDeviceAddress.

Definition at line 234 of file lora-network-status.cc.

References m_endDeviceStatuses.

◆ GetEndDeviceStatus() [2/2]

Ptr< LoraEndDeviceStatus > ns3::LoraNetworkStatus::GetEndDeviceStatus ( Ptr< const Packet >  packet)

Get the EndDeviceStatus for the device that sent a packet.

Definition at line 211 of file lora-network-status.cc.

References ns3::LoraFrameHeader::GetAddress(), and m_endDeviceStatuses.

+ Here is the call graph for this function:

◆ GetReplyForDevice()

Ptr< Packet > ns3::LoraNetworkStatus::GetReplyForDevice ( LoraDeviceAddress  edAddress,
int  windowNumber 
)

Get the reply for the specified device address.

Definition at line 180 of file lora-network-status.cc.

References m_endDeviceStatuses, ns3::LoraBeamTag::SetBeamId(), ns3::LoraTag::SetDataRate(), ns3::LoraTag::SetFrequency(), and ns3::LoraTag::SetModcod().

+ Here is the call graph for this function:

◆ GetTypeId()

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

Definition at line 45 of file lora-network-status.cc.

◆ NeedsReply()

bool ns3::LoraNetworkStatus::NeedsReply ( LoraDeviceAddress  deviceAddress)

Return whether the specified device needs a reply.

Parameters
deviceAddressthe address of the device we are interested in.

Definition at line 120 of file lora-network-status.cc.

References m_endDeviceStatuses.

◆ OnReceivedPacket()

void ns3::LoraNetworkStatus::OnReceivedPacket ( Ptr< const Packet >  packet,
const Address &  gwaddress 
)

Update network status on the received packet.

Parameters
packetthe received packet.
addressthe gateway this packet was received from.

Definition at line 99 of file lora-network-status.cc.

References ns3::LoraFrameHeader::GetAddress(), m_endDeviceStatuses, and ns3::LoraFrameHeader::SetAsUplink().

+ Here is the call graph for this function:

◆ SendThroughGateway()

void ns3::LoraNetworkStatus::SendThroughGateway ( Ptr< Packet >  packet,
Address  gwAddress 
)

Send a packet through a Gateway.

This function assumes that the packet is already tagged with a LoraTag that will inform the gateway of the parameters to use for the transmission.

Definition at line 172 of file lora-network-status.cc.

References m_gatewayStatuses.

Member Data Documentation

◆ m_endDeviceStatuses

std::map<LoraDeviceAddress, Ptr<LoraEndDeviceStatus> > ns3::LoraNetworkStatus::m_endDeviceStatuses

◆ m_gatewayStatuses

std::map<Address, Ptr<LoraGatewayStatus> > ns3::LoraNetworkStatus::m_gatewayStatuses

Definition at line 121 of file lora-network-status.h.

Referenced by AddGateway(), GetBestGatewayForDevice(), and SendThroughGateway().


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