11#include "ns3/wifi-net-device.h"
12#include "ns3/wifi-phy.h"
13#include "ns3/wifi-tx-current-model.h"
59 std::string deviceName = device->GetInstanceTypeId().GetName();
60 if (deviceName !=
"ns3::WifiNetDevice")
72 wifiPhy->SetWifiRadioEnergyModel(model);
92 source->AppendDeviceEnergyModel(model);
94 model->SetEnergySource(source);
96 wifiPhy->RegisterListener(model->GetPhyListener());
101 model->SetTxCurrentModel(txcurrent);
Hold a value for an Attribute.
void Nullify()
Discard the implementation, set it to null.
bool IsNull() const
Check for null implementation.
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.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Smart pointer class similar to boost::intrusive_ptr.
uint16_t GetUid() const
Get the internal id of this TypeId.
void SetOffMode()
Put in off mode.
void ResumeFromOff()
Resume from off mode.
~WifiRadioEnergyModelHelper() override
Destroy a RadioEnergy Helper.
void SetRechargedCallback(WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback)
void SetDepletionCallback(WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback)
Ptr< energy::DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const override
WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback
radio energy recharged callback
WifiRadioEnergyModelHelper()
Construct a helper which is used to add a radio energy model to a node.
WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback
radio energy depletion callback
void Set(std::string name, const AttributeValue &v) override
ObjectFactory m_radioEnergy
radio energy
ObjectFactory m_txCurrentModel
transmit current model
A WiFi 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.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.