#include "lora-adr-component.h"
Public Member Functions | |
LoraAdrComponent () | |
virtual | ~LoraAdrComponent () |
void | BeforeSendingReply (Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus) |
void | OnFailedReply (Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus) |
Method that is called when a packet cannot be sent in the downlink. More... | |
void | OnReceivedPacket (Ptr< const Packet > packet, Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus) |
Method that is called when a new packet is received by the NetworkServer. More... | |
Public Member Functions inherited from ns3::LoraNetworkControllerComponent | |
LoraNetworkControllerComponent () | |
virtual | ~LoraNetworkControllerComponent () |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::LoraNetworkControllerComponent | |
static TypeId | GetTypeId (void) |
Private Types | |
enum | CombiningMethod { AVERAGE , MAXIMUM , MINIMUM } |
Private Member Functions | |
void | AdrImplementation (uint8_t *newDataRate, uint8_t *newTxPower, Ptr< LoraEndDeviceStatus > status) |
double | GetAverageSNR (LoraEndDeviceStatus::ReceivedPacketList packetList, int historyRange) |
double | GetAverageTxFromGateways (LoraEndDeviceStatus::GatewayList gwList) |
double | GetMaxSNR (LoraEndDeviceStatus::ReceivedPacketList packetList, int historyRange) |
double | GetMaxTxFromGateways (LoraEndDeviceStatus::GatewayList gwList) |
double | GetMinSNR (LoraEndDeviceStatus::ReceivedPacketList packetList, int historyRange) |
double | GetMinTxFromGateways (LoraEndDeviceStatus::GatewayList gwList) |
double | GetReceivedPower (LoraEndDeviceStatus::GatewayList gwList) |
int | GetTxPowerIndex (int txPower) |
double | RxPowerToSNR (double transmissionPower) |
uint8_t | SfToDr (uint8_t sf) |
Private Attributes | |
const int | B = 125000 |
enum CombiningMethod | historyAveraging |
int | historyRange |
bool | m_toggleTxPower |
const int | max_transmissionPower = 14 |
const int | min_spreadingFactor = 7 |
const int | min_transmissionPower = 2 |
const int | NF = 6 |
enum CombiningMethod | tpAveraging |
double | treshold [6] = {-20.0, -17.5, -15.0, -12.5, -10.0, -7.5} |
Definition at line 41 of file lora-adr-component.h.
|
private |
Enumerator | |
---|---|
AVERAGE | |
MAXIMUM | |
MINIMUM |
Definition at line 43 of file lora-adr-component.h.
ns3::LoraAdrComponent::LoraAdrComponent | ( | ) |
Definition at line 83 of file lora-adr-component.cc.
|
virtual |
Definition at line 87 of file lora-adr-component.cc.
|
private |
Definition at line 189 of file lora-adr-component.cc.
References AVERAGE, GetAverageSNR(), GetMaxSNR(), GetMinSNR(), historyAveraging, historyRange, max_transmissionPower, MAXIMUM, min_spreadingFactor, min_transmissionPower, MINIMUM, SfToDr(), and treshold.
Referenced by BeforeSendingReply().
|
virtual |
Implements ns3::LoraNetworkControllerComponent.
Definition at line 103 of file lora-adr-component.cc.
References AdrImplementation(), ns3::LoraFrameHeader::GetAdr(), GetTxPowerIndex(), historyRange, m_toggleTxPower, ns3::LoraFrameHeader::SetAsUplink(), SfToDr(), and ns3::LorawanMacHeader::UNCONFIRMED_DATA_DOWN.
|
private |
Definition at line 428 of file lora-adr-component.cc.
References GetReceivedPower(), historyRange, and RxPowerToSNR().
Referenced by AdrImplementation().
|
private |
Definition at line 339 of file lora-adr-component.cc.
Referenced by GetReceivedPower().
|
private |
Definition at line 401 of file lora-adr-component.cc.
References GetReceivedPower(), historyRange, and RxPowerToSNR().
Referenced by AdrImplementation().
|
private |
Definition at line 321 of file lora-adr-component.cc.
Referenced by GetReceivedPower().
|
private |
Definition at line 374 of file lora-adr-component.cc.
References GetReceivedPower(), historyRange, and RxPowerToSNR().
Referenced by AdrImplementation().
|
private |
Definition at line 303 of file lora-adr-component.cc.
Referenced by GetReceivedPower().
|
private |
Definition at line 357 of file lora-adr-component.cc.
References AVERAGE, GetAverageTxFromGateways(), GetMaxTxFromGateways(), GetMinTxFromGateways(), MAXIMUM, MINIMUM, and tpAveraging.
Referenced by GetAverageSNR(), GetMaxSNR(), and GetMinSNR().
|
private |
Definition at line 454 of file lora-adr-component.cc.
Referenced by BeforeSendingReply().
|
static |
Definition at line 42 of file lora-adr-component.cc.
References AVERAGE, historyAveraging, historyRange, m_toggleTxPower, MAXIMUM, MINIMUM, and tpAveraging.
Referenced by OnFailedReply(), and OnReceivedPacket().
|
virtual |
Method that is called when a packet cannot be sent in the downlink.
status | The EndDeviceStatus of the device to which it was impossible to send a reply. |
networkStatus | A pointer to the NetworkStatus object |
Implements ns3::LoraNetworkControllerComponent.
Definition at line 182 of file lora-adr-component.cc.
References GetTypeId().
|
virtual |
Method that is called when a new packet is received by the NetworkServer.
packet | The newly received packet |
networkStatus | A pointer to the NetworkStatus object |
Implements ns3::LoraNetworkControllerComponent.
Definition at line 92 of file lora-adr-component.cc.
References GetTypeId().
|
private |
Definition at line 295 of file lora-adr-component.cc.
Referenced by GetAverageSNR(), GetMaxSNR(), and GetMinSNR().
|
private |
Definition at line 269 of file lora-adr-component.cc.
Referenced by AdrImplementation(), and BeforeSendingReply().
|
private |
Definition at line 113 of file lora-adr-component.h.
Referenced by RxPowerToSNR().
|
private |
Definition at line 95 of file lora-adr-component.h.
Referenced by AdrImplementation(), and GetTypeId().
|
private |
Definition at line 95 of file lora-adr-component.h.
Referenced by AdrImplementation(), BeforeSendingReply(), GetAverageSNR(), GetMaxSNR(), GetMinSNR(), and GetTypeId().
|
private |
Definition at line 122 of file lora-adr-component.h.
Referenced by BeforeSendingReply(), and GetTypeId().
|
private |
Definition at line 107 of file lora-adr-component.h.
Referenced by AdrImplementation().
|
private |
Definition at line 101 of file lora-adr-component.h.
Referenced by AdrImplementation().
|
private |
Definition at line 104 of file lora-adr-component.h.
Referenced by AdrImplementation().
|
private |
Definition at line 116 of file lora-adr-component.h.
Referenced by RxPowerToSNR().
|
private |
Definition at line 89 of file lora-adr-component.h.
Referenced by GetReceivedPower(), and GetTypeId().
|
private |
Definition at line 120 of file lora-adr-component.h.
Referenced by AdrImplementation().