A Discrete-Event Network Simulator
API
ns3::WifiPhyStateHelper Class Reference

This objects implements the PHY state machine of the Wifi device. More...

#include "wifi-phy-state-helper.h"

+ Inheritance diagram for ns3::WifiPhyStateHelper:
+ Collaboration diagram for ns3::WifiPhyStateHelper:

Public Types

typedef void(* RxEndErrorTracedCallback) (Ptr< const Packet > packet, double snr)
 TracedCallback signature for receive end error event. More...
 
typedef void(* RxOkTracedCallback) (Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble)
 TracedCallback signature for receive end OK event. More...
 
typedef void(* StateTracedCallback) (Time start, Time duration, WifiPhyState state)
 TracedCallback signature for state changes. More...
 
typedef void(* TxTracedCallback) (Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t power)
 TracedCallback signature for transmit event. More...
 

Public Member Functions

 WifiPhyStateHelper ()
 
void ContinueRxNextMpdu (Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector)
 Continue RX after the reception of an MPDU in an A-MPDU was successful. More...
 
Time GetDelayUntilIdle (void) const
 Return the time before the state is back to IDLE. More...
 
Time GetLastRxEndTime (void) const
 Return the time the last RX end. More...
 
Time GetLastRxStartTime (void) const
 Return the time the last RX start. More...
 
WifiPhyState GetState (void) const
 Return the current state of WifiPhy. More...
 
bool IsStateCcaBusy (void) const
 Check whether the current state is CCA busy. More...
 
bool IsStateIdle (void) const
 Check whether the current state is IDLE. More...
 
bool IsStateOff (void) const
 Check whether the current state is OFF. More...
 
bool IsStateRx (void) const
 Check whether the current state is RX. More...
 
bool IsStateSleep (void) const
 Check whether the current state is SLEEP. More...
 
bool IsStateSwitching (void) const
 Check whether the current state is SWITCHING. More...
 
bool IsStateTx (void) const
 Check whether the current state is TX. More...
 
void RegisterListener (WifiPhyListener *listener)
 Register WifiPhyListener to this WifiPhyStateHelper. More...
 
void SetReceiveErrorCallback (RxErrorCallback callback)
 Set a callback for a failed reception. More...
 
void SetReceiveOkCallback (RxOkCallback callback)
 Set a callback for a successful reception. More...
 
void SwitchFromOff (void)
 Switch from off mode. More...
 
void SwitchFromRxAbort (void)
 Abort current reception. More...
 
void SwitchFromRxEndError (Ptr< WifiPsdu > psdu, double snr)
 Switch from RX after the reception failed. More...
 
void SwitchFromRxEndOk (Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, uint16_t staId, std::vector< bool > statusPerMpdu)
 Switch from RX after the reception was successful. More...
 
void SwitchFromSleep (void)
 Switch from sleep mode. More...
 
void SwitchMaybeToCcaBusy (Time duration)
 Switch to CCA busy. More...
 
void SwitchToChannelSwitching (Time switchingDuration)
 Switch state to channel switching for the given duration. More...
 
void SwitchToOff (void)
 Switch to off mode. More...
 
void SwitchToRx (Time rxDuration)
 Switch state to RX for the given duration. More...
 
void SwitchToSleep (void)
 Switch to sleep mode. More...
 
void SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, WifiTxVector txVector)
 Switch state to TX for the given duration. More...
 
void UnregisterListener (WifiPhyListener *listener)
 Remove WifiPhyListener from this WifiPhyStateHelper. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Types

typedef std::vector< WifiPhyListener * > Listeners
 typedef for a list of WifiPhyListeners More...
 

Private Member Functions

void DoSwitchFromRx (void)
 Switch the state from RX. More...
 
void LogPreviousIdleAndCcaBusyStates (void)
 Log the idle and CCA busy states. More...
 
void NotifyMaybeCcaBusyStart (Time duration)
 Notify all WifiPhyListener that the CCA has started for the given duration. More...
 
void NotifyOff (void)
 Notify all WifiPhyListener that we are going to switch off. More...
 
void NotifyOn (void)
 Notify all WifiPhyListener that we are going to switch on. More...
 
void NotifyRxEndError (void)
 Notify all WifiPhyListener that the reception was not successful. More...
 
void NotifyRxEndOk (void)
 Notify all WifiPhyListener that the reception was successful. More...
 
void NotifyRxStart (Time duration)
 Notify all WifiPhyListener that the reception has started for the given duration. More...
 
void NotifySleep (void)
 Notify all WifiPhyListener that we are going to sleep. More...
 
void NotifySwitchingStart (Time duration)
 Notify all WifiPhyListener that we are switching channel with the given channel switching delay. More...
 
void NotifyTxStart (Time duration, double txPowerDbm)
 Notify all WifiPhyListener that the transmission has started for the given duration. More...
 
void NotifyWakeup (void)
 Notify all WifiPhyListener that we woke up. More...
 

Private Attributes

Time m_endCcaBusy
 end CCA busy More...
 
Time m_endRx
 end receive More...
 
Time m_endSwitching
 end switching More...
 
Time m_endTx
 end transmit More...
 
bool m_isOff
 switched off More...
 
Listeners m_listeners
 listeners More...
 
Time m_previousStateChangeTime
 previous state change time More...
 
RxErrorCallback m_rxErrorCallback
 receive error callback More...
 
TracedCallback< Ptr< const Packet >, double > m_rxErrorTrace
 receive error trace callback More...
 
RxOkCallback m_rxOkCallback
 receive OK callback More...
 
TracedCallback< Ptr< const Packet >, double, WifiMode, WifiPreamblem_rxOkTrace
 receive OK trace callback More...
 
bool m_sleeping
 sleeping More...
 
Time m_startCcaBusy
 start CCA busy More...
 
Time m_startRx
 start receive More...
 
Time m_startSleep
 start sleep More...
 
Time m_startSwitching
 start switching More...
 
Time m_startTx
 start transmit More...
 
TracedCallback< Time, Time, WifiPhyStatem_stateLogger
 The trace source fired when state is changed. More...
 
TracedCallback< Ptr< const Packet >, WifiMode, WifiPreamble, uint8_t > m_txTrace
 transmit trace callback More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

This objects implements the PHY state machine of the Wifi device.

Config Paths

ns3::WifiPhyStateHelper is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Phy/State"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/PhyEntities/[i]/State"

No Attributes are defined for this type.

TraceSources

Size of this type is 256 bytes (on a 64-bit architecture).

Definition at line 65 of file wifi-phy-state-helper.h.

Member Typedef Documentation

◆ Listeners

typedef std::vector<WifiPhyListener *> ns3::WifiPhyStateHelper::Listeners
private

typedef for a list of WifiPhyListeners

Definition at line 285 of file wifi-phy-state-helper.h.

◆ RxEndErrorTracedCallback

typedef void(* ns3::WifiPhyStateHelper::RxEndErrorTracedCallback) (Ptr< const Packet > packet, double snr)

TracedCallback signature for receive end error event.

Parameters
[in]packetThe received packet.
[in]snrThe SNR of the received packet in linear scale.

Definition at line 267 of file wifi-phy-state-helper.h.

◆ RxOkTracedCallback

typedef void(* ns3::WifiPhyStateHelper::RxOkTracedCallback) (Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble)

TracedCallback signature for receive end OK event.

Parameters
[in]packetThe received packet.
[in]snrThe SNR of the received packet in linear scale.
[in]modeThe transmission mode of the packet.
[in]preambleThe preamble of the packet.

Definition at line 259 of file wifi-phy-state-helper.h.

◆ StateTracedCallback

typedef void(* ns3::WifiPhyStateHelper::StateTracedCallback) (Time start, Time duration, WifiPhyState state)

TracedCallback signature for state changes.

Parameters
[in]startTime when the state started.
[in]durationAmount of time we've been in (or will be in) the state.
[in]stateThe state.

Definition at line 249 of file wifi-phy-state-helper.h.

◆ TxTracedCallback

typedef void(* ns3::WifiPhyStateHelper::TxTracedCallback) (Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t power)

TracedCallback signature for transmit event.

Parameters
[in]packetThe received packet.
[in]modeThe transmission mode of the packet.
[in]preambleThe preamble of the packet.
[in]powerThe transmit power level.

Definition at line 277 of file wifi-phy-state-helper.h.

Constructor & Destructor Documentation

◆ WifiPhyStateHelper()

ns3::WifiPhyStateHelper::WifiPhyStateHelper ( )

Definition at line 63 of file wifi-phy-state-helper.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ ContinueRxNextMpdu()

void ns3::WifiPhyStateHelper::ContinueRxNextMpdu ( Ptr< WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector 
)

Continue RX after the reception of an MPDU in an A-MPDU was successful.

Parameters
psduthe successfully received PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorTXVECTOR of the PSDU

Definition at line 458 of file wifi-phy-state-helper.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_rxOkCallback, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoSwitchFromRx()

void ns3::WifiPhyStateHelper::DoSwitchFromRx ( void  )
private

Switch the state from RX.

Definition at line 508 of file wifi-phy-state-helper.cc.

References IsStateCcaBusy(), IsStateIdle(), m_endRx, m_previousStateChangeTime, m_startRx, m_stateLogger, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and RX.

Referenced by SwitchFromRxAbort(), SwitchFromRxEndError(), and SwitchFromRxEndOk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDelayUntilIdle()

Time ns3::WifiPhyStateHelper::GetDelayUntilIdle ( void  ) const

Return the time before the state is back to IDLE.

Returns
the delay before the state is back to IDLE

Definition at line 151 of file wifi-phy-state-helper.cc.

References CCA_BUSY, GetState(), IDLE, m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, ns3::Max(), ns3::Simulator::Now(), NS_FATAL_ERROR, OFF, RX, ns3::Seconds(), SLEEP, SWITCHING, and TX.

+ Here is the call graph for this function:

◆ GetLastRxEndTime()

Time ns3::WifiPhyStateHelper::GetLastRxEndTime ( void  ) const

Return the time the last RX end.

Returns
the time the last RX end.

Definition at line 190 of file wifi-phy-state-helper.cc.

References m_endRx.

◆ GetLastRxStartTime()

Time ns3::WifiPhyStateHelper::GetLastRxStartTime ( void  ) const

Return the time the last RX start.

Returns
the time the last RX start.

Definition at line 184 of file wifi-phy-state-helper.cc.

References m_startRx.

◆ GetState()

WifiPhyState ns3::WifiPhyStateHelper::GetState ( void  ) const

Return the current state of WifiPhy.

Returns
the current state of WifiPhy

Definition at line 196 of file wifi-phy-state-helper.cc.

References CCA_BUSY, IDLE, m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_isOff, m_sleeping, ns3::Simulator::Now(), OFF, RX, SLEEP, SWITCHING, and TX.

Referenced by GetDelayUntilIdle(), IsStateCcaBusy(), IsStateIdle(), IsStateOff(), IsStateRx(), IsStateSleep(), IsStateSwitching(), IsStateTx(), LogPreviousIdleAndCcaBusyStates(), SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), SwitchToSleep(), and SwitchToTx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::WifiPhyStateHelper::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 38 of file wifi-phy-state-helper.cc.

References m_rxErrorTrace, m_rxOkTrace, m_stateLogger, m_txTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IsStateCcaBusy()

bool ns3::WifiPhyStateHelper::IsStateCcaBusy ( void  ) const

Check whether the current state is CCA busy.

Returns
true if the current state is CCA busy, false otherwise

Definition at line 115 of file wifi-phy-state-helper.cc.

References CCA_BUSY, and GetState().

Referenced by DoSwitchFromRx(), SwitchFromRxAbort(), and SwitchToRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStateIdle()

bool ns3::WifiPhyStateHelper::IsStateIdle ( void  ) const

Check whether the current state is IDLE.

Returns
true if the current state is IDLE, false otherwise

Definition at line 109 of file wifi-phy-state-helper.cc.

References GetState(), and IDLE.

Referenced by DoSwitchFromRx(), SwitchFromRxAbort(), and SwitchToRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStateOff()

bool ns3::WifiPhyStateHelper::IsStateOff ( void  ) const

Check whether the current state is OFF.

Returns
true if the current state is OFF, false otherwise

Definition at line 145 of file wifi-phy-state-helper.cc.

References GetState(), and OFF.

Referenced by SwitchFromOff(), and SwitchToOff().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStateRx()

bool ns3::WifiPhyStateHelper::IsStateRx ( void  ) const

Check whether the current state is RX.

Returns
true if the current state is RX, false otherwise

Definition at line 121 of file wifi-phy-state-helper.cc.

References GetState(), and RX.

Referenced by SwitchToRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStateSleep()

bool ns3::WifiPhyStateHelper::IsStateSleep ( void  ) const

Check whether the current state is SLEEP.

Returns
true if the current state is SLEEP, false otherwise

Definition at line 139 of file wifi-phy-state-helper.cc.

References GetState(), and SLEEP.

Referenced by SwitchFromSleep(), and SwitchToSleep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStateSwitching()

bool ns3::WifiPhyStateHelper::IsStateSwitching ( void  ) const

Check whether the current state is SWITCHING.

Returns
true if the current state is SWITCHING, false otherwise

Definition at line 133 of file wifi-phy-state-helper.cc.

References GetState(), and SWITCHING.

Referenced by SwitchToChannelSwitching().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsStateTx()

bool ns3::WifiPhyStateHelper::IsStateTx ( void  ) const

Check whether the current state is TX.

Returns
true if the current state is TX, false otherwise

Definition at line 127 of file wifi-phy-state-helper.cc.

References GetState(), and TX.

+ Here is the call graph for this function:

◆ LogPreviousIdleAndCcaBusyStates()

void ns3::WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates ( void  )
private

Log the idle and CCA busy states.

Definition at line 329 of file wifi-phy-state-helper.cc.

References CCA_BUSY, GetState(), IDLE, ns3::Time::IsStrictlyPositive(), m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_startCcaBusy, m_stateLogger, max, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), SwitchToSleep(), and SwitchToTx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyMaybeCcaBusyStart()

void ns3::WifiPhyStateHelper::NotifyMaybeCcaBusyStart ( Time  duration)
private

Notify all WifiPhyListener that the CCA has started for the given duration.

Parameters
durationthe duration of the CCA state

Definition at line 269 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchFromRxAbort(), and SwitchMaybeToCcaBusy().

+ Here is the caller graph for this function:

◆ NotifyOff()

void ns3::WifiPhyStateHelper::NotifyOff ( void  )
private

Notify all WifiPhyListener that we are going to switch off.

Definition at line 299 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchToOff().

+ Here is the caller graph for this function:

◆ NotifyOn()

void ns3::WifiPhyStateHelper::NotifyOn ( void  )
private

Notify all WifiPhyListener that we are going to switch on.

Definition at line 319 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchFromOff().

+ Here is the caller graph for this function:

◆ NotifyRxEndError()

void ns3::WifiPhyStateHelper::NotifyRxEndError ( void  )
private

Notify all WifiPhyListener that the reception was not successful.

Definition at line 259 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchFromRxEndError().

+ Here is the caller graph for this function:

◆ NotifyRxEndOk()

void ns3::WifiPhyStateHelper::NotifyRxEndOk ( void  )
private

Notify all WifiPhyListener that the reception was successful.

Definition at line 249 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchFromRxAbort(), and SwitchFromRxEndOk().

+ Here is the caller graph for this function:

◆ NotifyRxStart()

void ns3::WifiPhyStateHelper::NotifyRxStart ( Time  duration)
private

Notify all WifiPhyListener that the reception has started for the given duration.

Parameters
durationthe duration of the reception

Definition at line 239 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchToRx().

+ Here is the caller graph for this function:

◆ NotifySleep()

void ns3::WifiPhyStateHelper::NotifySleep ( void  )
private

Notify all WifiPhyListener that we are going to sleep.

Definition at line 289 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchToSleep().

+ Here is the caller graph for this function:

◆ NotifySwitchingStart()

void ns3::WifiPhyStateHelper::NotifySwitchingStart ( Time  duration)
private

Notify all WifiPhyListener that we are switching channel with the given channel switching delay.

Parameters
durationthe delay to switch the channel

Definition at line 279 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchToChannelSwitching().

+ Here is the caller graph for this function:

◆ NotifyTxStart()

void ns3::WifiPhyStateHelper::NotifyTxStart ( Time  duration,
double  txPowerDbm 
)
private

Notify all WifiPhyListener that the transmission has started for the given duration.

Parameters
durationthe duration of the transmission
txPowerDbmthe nominal TX power in dBm

Definition at line 229 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchToTx().

+ Here is the caller graph for this function:

◆ NotifyWakeup()

void ns3::WifiPhyStateHelper::NotifyWakeup ( void  )
private

Notify all WifiPhyListener that we woke up.

Definition at line 309 of file wifi-phy-state-helper.cc.

References m_listeners, and NS_LOG_FUNCTION.

Referenced by SwitchFromSleep().

+ Here is the caller graph for this function:

◆ RegisterListener()

void ns3::WifiPhyStateHelper::RegisterListener ( WifiPhyListener listener)

Register WifiPhyListener to this WifiPhyStateHelper.

Parameters
listenerthe WifiPhyListener to register

Definition at line 93 of file wifi-phy-state-helper.cc.

References m_listeners.

◆ SetReceiveErrorCallback()

void ns3::WifiPhyStateHelper::SetReceiveErrorCallback ( RxErrorCallback  callback)

Set a callback for a failed reception.

Parameters
callbackthe RxErrorCallback to set

Definition at line 87 of file wifi-phy-state-helper.cc.

References m_rxErrorCallback.

◆ SetReceiveOkCallback()

void ns3::WifiPhyStateHelper::SetReceiveOkCallback ( RxOkCallback  callback)

Set a callback for a successful reception.

Parameters
callbackthe RxOkCallback to set

Definition at line 81 of file wifi-phy-state-helper.cc.

References m_rxOkCallback.

◆ SwitchFromOff()

void ns3::WifiPhyStateHelper::SwitchFromOff ( void  )

Switch from off mode.

Definition at line 628 of file wifi-phy-state-helper.cc.

References IsStateOff(), m_isOff, m_previousStateChangeTime, NotifyOn(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SwitchFromRxAbort()

void ns3::WifiPhyStateHelper::SwitchFromRxAbort ( void  )

Abort current reception.

Definition at line 580 of file wifi-phy-state-helper.cc.

References DoSwitchFromRx(), IsStateCcaBusy(), IsStateIdle(), m_endCcaBusy, NotifyMaybeCcaBusyStart(), NotifyRxEndOk(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::Seconds().

+ Here is the call graph for this function:

◆ SwitchFromRxEndError()

void ns3::WifiPhyStateHelper::SwitchFromRxEndError ( Ptr< WifiPsdu psdu,
double  snr 
)

Switch from RX after the reception failed.

Parameters
psduthe PSDU that we failed to received
snrthe SNR of the received PSDU in linear scale

Definition at line 490 of file wifi-phy-state-helper.cc.

References ns3::Abs(), DoSwitchFromRx(), ns3::WifiPsdu::GetPacket(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_endRx, m_rxErrorCallback, m_rxErrorTrace, ns3::MicroSeconds(), NotifyRxEndError(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SwitchFromRxEndOk()

void ns3::WifiPhyStateHelper::SwitchFromRxEndOk ( Ptr< WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector,
uint16_t  staId,
std::vector< bool >  statusPerMpdu 
)

Switch from RX after the reception was successful.

Parameters
psduthe successfully received PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorTXVECTOR of the PSDU
staIdthe station ID of the PSDU (only used for MU)
statusPerMpdureception status per MPDU

Definition at line 469 of file wifi-phy-state-helper.cc.

References ns3::Abs(), DoSwitchFromRx(), ns3::WifiTxVector::GetMode(), ns3::WifiPsdu::GetPacket(), ns3::WifiTxVector::GetPreambleType(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_endRx, m_rxOkCallback, m_rxOkTrace, ns3::MicroSeconds(), NotifyRxEndOk(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::RxSignalInfo::snr.

+ Here is the call graph for this function:

◆ SwitchFromSleep()

void ns3::WifiPhyStateHelper::SwitchFromSleep ( void  )

Switch from sleep mode.

Definition at line 568 of file wifi-phy-state-helper.cc.

References IsStateSleep(), m_previousStateChangeTime, m_sleeping, m_startSleep, m_stateLogger, NotifyWakeup(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and SLEEP.

+ Here is the call graph for this function:

◆ SwitchMaybeToCcaBusy()

void ns3::WifiPhyStateHelper::SwitchMaybeToCcaBusy ( Time  duration)

Switch to CCA busy.

Parameters
durationthe duration of CCA busy state

Definition at line 519 of file wifi-phy-state-helper.cc.

References CCA_BUSY, GetState(), IDLE, LogPreviousIdleAndCcaBusyStates(), m_endCcaBusy, m_startCcaBusy, max, NotifyMaybeCcaBusyStart(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and RX.

+ Here is the call graph for this function:

◆ SwitchToChannelSwitching()

void ns3::WifiPhyStateHelper::SwitchToChannelSwitching ( Time  switchingDuration)

Switch state to channel switching for the given duration.

Parameters
switchingDurationthe duration of required to switch the channel

Definition at line 425 of file wifi-phy-state-helper.cc.

References CCA_BUSY, GetState(), IDLE, IsStateSwitching(), LogPreviousIdleAndCcaBusyStates(), m_endCcaBusy, m_endRx, m_endSwitching, m_previousStateChangeTime, m_startRx, m_startSwitching, m_stateLogger, min, NotifySwitchingStart(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, RX, and SWITCHING.

+ Here is the call graph for this function:

◆ SwitchToOff()

void ns3::WifiPhyStateHelper::SwitchToOff ( void  )

◆ SwitchToRx()

void ns3::WifiPhyStateHelper::SwitchToRx ( Time  rxDuration)

Switch state to RX for the given duration.

Parameters
rxDurationthe duration of the RX

Definition at line 401 of file wifi-phy-state-helper.cc.

References CCA_BUSY, GetState(), IDLE, IsStateCcaBusy(), IsStateIdle(), IsStateRx(), LogPreviousIdleAndCcaBusyStates(), m_endRx, m_previousStateChangeTime, m_startRx, NotifyRxStart(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SwitchToSleep()

void ns3::WifiPhyStateHelper::SwitchToSleep ( void  )

◆ SwitchToTx()

void ns3::WifiPhyStateHelper::SwitchToTx ( Time  txDuration,
WifiConstPsduMap  psdus,
double  txPowerDbm,
WifiTxVector  txVector 
)

Switch state to TX for the given duration.

Parameters
txDurationthe duration of the PPDU to transmit
psdusthe PSDUs in the transmitted PPDU (only one unless it is a MU PPDU)
txPowerDbmthe nominal TX power in dBm
txVectorthe TX vector for the transmission

Definition at line 363 of file wifi-phy-state-helper.cc.

References CCA_BUSY, ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetPreambleType(), GetState(), ns3::WifiTxVector::GetTxPowerLevel(), IDLE, LogPreviousIdleAndCcaBusyStates(), m_endRx, m_endTx, m_previousStateChangeTime, m_startRx, m_startTx, m_stateLogger, m_txTrace, NotifyTxStart(), ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_FUNCTION, RX, and TX.

+ Here is the call graph for this function:

◆ UnregisterListener()

void ns3::WifiPhyStateHelper::UnregisterListener ( WifiPhyListener listener)

Remove WifiPhyListener from this WifiPhyStateHelper.

Parameters
listenerthe WifiPhyListener to unregister

Definition at line 99 of file wifi-phy-state-helper.cc.

References m_listeners.

Member Data Documentation

◆ m_endCcaBusy

Time ns3::WifiPhyStateHelper::m_endCcaBusy
private

◆ m_endRx

◆ m_endSwitching

Time ns3::WifiPhyStateHelper::m_endSwitching
private

◆ m_endTx

Time ns3::WifiPhyStateHelper::m_endTx
private

◆ m_isOff

bool ns3::WifiPhyStateHelper::m_isOff
private

switched off

Definition at line 353 of file wifi-phy-state-helper.h.

Referenced by GetState(), SwitchFromOff(), and SwitchToOff().

◆ m_listeners

◆ m_previousStateChangeTime

Time ns3::WifiPhyStateHelper::m_previousStateChangeTime
private

◆ m_rxErrorCallback

RxErrorCallback ns3::WifiPhyStateHelper::m_rxErrorCallback
private

receive error callback

Definition at line 370 of file wifi-phy-state-helper.h.

Referenced by SetReceiveErrorCallback(), and SwitchFromRxEndError().

◆ m_rxErrorTrace

TracedCallback<Ptr<const Packet>, double> ns3::WifiPhyStateHelper::m_rxErrorTrace
private

receive error trace callback

Definition at line 367 of file wifi-phy-state-helper.h.

Referenced by GetTypeId(), and SwitchFromRxEndError().

◆ m_rxOkCallback

RxOkCallback ns3::WifiPhyStateHelper::m_rxOkCallback
private

receive OK callback

Definition at line 369 of file wifi-phy-state-helper.h.

Referenced by ContinueRxNextMpdu(), SetReceiveOkCallback(), and SwitchFromRxEndOk().

◆ m_rxOkTrace

TracedCallback<Ptr<const Packet>, double, WifiMode, WifiPreamble> ns3::WifiPhyStateHelper::m_rxOkTrace
private

receive OK trace callback

Definition at line 366 of file wifi-phy-state-helper.h.

Referenced by GetTypeId(), and SwitchFromRxEndOk().

◆ m_sleeping

bool ns3::WifiPhyStateHelper::m_sleeping
private

sleeping

Definition at line 352 of file wifi-phy-state-helper.h.

Referenced by GetState(), SwitchFromSleep(), and SwitchToSleep().

◆ m_startCcaBusy

Time ns3::WifiPhyStateHelper::m_startCcaBusy
private

start CCA busy

Definition at line 360 of file wifi-phy-state-helper.h.

Referenced by LogPreviousIdleAndCcaBusyStates(), and SwitchMaybeToCcaBusy().

◆ m_startRx

Time ns3::WifiPhyStateHelper::m_startRx
private

◆ m_startSleep

Time ns3::WifiPhyStateHelper::m_startSleep
private

start sleep

Definition at line 362 of file wifi-phy-state-helper.h.

Referenced by SwitchFromSleep(), and SwitchToSleep().

◆ m_startSwitching

Time ns3::WifiPhyStateHelper::m_startSwitching
private

start switching

Definition at line 361 of file wifi-phy-state-helper.h.

Referenced by SwitchToChannelSwitching().

◆ m_startTx

Time ns3::WifiPhyStateHelper::m_startTx
private

start transmit

Definition at line 358 of file wifi-phy-state-helper.h.

Referenced by SwitchToOff(), and SwitchToTx().

◆ m_stateLogger

TracedCallback<Time, Time, WifiPhyState> ns3::WifiPhyStateHelper::m_stateLogger
private

The trace source fired when state is changed.

Definition at line 350 of file wifi-phy-state-helper.h.

Referenced by DoSwitchFromRx(), GetTypeId(), LogPreviousIdleAndCcaBusyStates(), SwitchFromSleep(), SwitchToChannelSwitching(), SwitchToOff(), and SwitchToTx().

◆ m_txTrace

TracedCallback<Ptr<const Packet>, WifiMode, WifiPreamble, uint8_t> ns3::WifiPhyStateHelper::m_txTrace
private

transmit trace callback

Definition at line 368 of file wifi-phy-state-helper.h.

Referenced by GetTypeId(), and SwitchToTx().


The documentation for this class was generated from the following files: