11#include "ns3/end-device-lora-phy.h"
12#include "ns3/lora-net-device.h"
13#include "ns3/lora-tx-current-model.h"
77 std::string deviceName = device->GetInstanceTypeId().GetName();
78 if (deviceName !=
"ns3::LoraNetDevice")
86 model->SetEnergySource(source);
93 source->AppendDeviceEnergyModel(model);
95 loraPhy->RegisterListener(model->GetPhyListener());
100 model->SetTxCurrentModel(txcurrent);
Hold a value for an Attribute.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
TypeId GetTypeId() const
Get the TypeId which will be created by this ObjectFactory.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Smart pointer class similar to boost::intrusive_ptr.
uint16_t GetUid() const
Get the internal id of this TypeId.
ObjectFactory m_radioEnergy
radio energy
Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const override
void Set(std::string name, const AttributeValue &v) override
ObjectFactory m_txCurrentModel
transmit current model
~LoraRadioEnergyModelHelper() override
Destructor.
void SetTxCurrentModel(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
LoraRadioEnergyModelHelper()
Default constructor.
A LoRa radio energy model.
Model the transmit current as a function of the transmit power and mode.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.