22 #include "ns3/wifi-net-device.h" 23 #include "ns3/wifi-tx-current-model.h" 24 #include "ns3/wifi-phy.h" 95 std::string deviceName = device->GetInstanceTypeId ().GetName ();
96 if (deviceName.compare (
"ns3::WifiNetDevice") != 0)
108 wifiPhy->SetWifiRadioEnergyModel (model);
128 source->AppendDeviceEnergyModel (model);
130 model->SetEnergySource (source);
132 wifiPhy->RegisterListener (model->GetPhyListener ());
137 model->SetTxCurrentModel (txcurrent);
Smart pointer class similar to boost::intrusive_ptr.
void SetDepletionCallback(WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback)
void ResumeFromOff(void)
Resume from off mode.
Hold a value for an Attribute.
#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.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const
uint16_t GetUid(void) const
Get the internal id of this TypeId.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Set(std::string name, const AttributeValue &v)
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
A WiFi radio energy model.
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
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.
bool IsNull(void) const
Check for null implementation.
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