22 #include "ns3/wifi-net-device.h"
23 #include "ns3/wifi-tx-current-model.h"
94 std::string deviceName = device->GetInstanceTypeId ().GetName ();
95 if (deviceName.compare (
"ns3::WifiNetDevice") != 0)
107 wifiPhy->SetWifiRadioEnergyModel (model);
127 source->AppendDeviceEnergyModel (model);
129 model->SetEnergySource (source);
131 wifiPhy->RegisterListener (model->GetPhyListener ());
136 model->SetTxCurrentModel (txcurrent);
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
Smart pointer class similar to boost::intrusive_ptr.
void SetDepletionCallback(WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback)
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void ResumeFromOff(void)
Resume from off mode.
Hold a value for an Attribute.
bool IsNull(void) const
Check for null implementation.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback
radio energy recharged callback
WifiRadioEnergyModelHelper()
Construct a helper which is used to add a radio energy model to a node.
~WifiRadioEnergyModelHelper()
Destroy a RadioEnergy Helper.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
ObjectFactory m_radioEnergy
radio energy
WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback
radio energy depletion callback
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void SetOffMode(void)
Put in off mode.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Set(std::string name, const AttributeValue &v)
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
uint16_t GetUid(void) const
Get the internal id of this TypeId.
A WiFi radio energy model.
Instantiate subclasses of ns3::Object.
void Nullify(void)
Discard the implementation, set it to null.
Modelize the transmit current as a function of the transmit power and mode.
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())
void SetRechargedCallback(WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback)
ObjectFactory m_txCurrentModel
transmit current model