This objects implements the PHY state machine of the Wifi device. More...
#include "wifi-phy-state-helper.h"
Public Types | |
typedef void(* | RxEndErrorTracedCallback) (Ptr< const Packet > packet, double snr) |
TracedCallback signature for receive end error event. | |
typedef void(* | RxOkTracedCallback) (Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble) |
TracedCallback signature for receive end OK event. | |
typedef void(* | StateTracedCallback) (Time start, Time duration, WifiPhyState state) |
TracedCallback signature for state changes. | |
typedef void(* | TxTracedCallback) (Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t power) |
TracedCallback signature for transmit event. | |
Public Member Functions | |
WifiPhyStateHelper () | |
Time | GetDelayUntilIdle () const |
Return the time before the state is back to IDLE. | |
Time | GetLastRxEndTime () const |
Return the time the last RX end. | |
Time | GetLastRxStartTime () const |
Return the time the last RX start. | |
WifiPhyState | GetState () const |
Return the current state of WifiPhy. | |
bool | IsStateCcaBusy () const |
Check whether the current state is CCA busy. | |
bool | IsStateIdle () const |
Check whether the current state is IDLE. | |
bool | IsStateOff () const |
Check whether the current state is OFF. | |
bool | IsStateRx () const |
Check whether the current state is RX. | |
bool | IsStateSleep () const |
Check whether the current state is SLEEP. | |
bool | IsStateSwitching () const |
Check whether the current state is SWITCHING. | |
bool | IsStateTx () const |
Check whether the current state is TX. | |
void | NotifyRxMpdu (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector) |
Notify the reception of an MPDU included in an A-MPDU. | |
void | NotifyRxPsduFailed (Ptr< const WifiPsdu > psdu, double snr) |
Handle the unsuccessful reception of a PSDU. | |
void | NotifyRxPsduSucceeded (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, uint16_t staId, const std::vector< bool > &statusPerMpdu) |
Handle the successful reception of a PSDU. | |
void | RegisterListener (WifiPhyListener *listener) |
Register WifiPhyListener to this WifiPhyStateHelper. | |
void | SetReceiveErrorCallback (RxErrorCallback callback) |
Set a callback for a failed reception. | |
void | SetReceiveOkCallback (RxOkCallback callback) |
Set a callback for a successful reception. | |
void | SwitchFromOff () |
Switch from off mode. | |
void | SwitchFromRxAbort (uint16_t operatingWidth) |
Abort current reception following a CCA reset request. | |
void | SwitchFromRxEndError () |
Switch from RX after the reception failed. | |
void | SwitchFromRxEndOk () |
Switch from RX after the reception was successful. | |
void | SwitchFromSleep () |
Switch from sleep mode. | |
void | SwitchMaybeToCcaBusy (Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations) |
Switch to CCA busy. | |
void | SwitchToChannelSwitching (Time switchingDuration) |
Switch state to channel switching for the given duration. | |
void | SwitchToOff () |
Switch to off mode. | |
void | SwitchToRx (Time rxDuration) |
Switch state to RX for the given duration. | |
void | SwitchToSleep () |
Switch to sleep mode. | |
void | SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, const WifiTxVector &txVector) |
Switch state to TX for the given duration. | |
void | UnregisterListener (WifiPhyListener *listener) |
Remove WifiPhyListener from this WifiPhyStateHelper. | |
![]() | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
![]() | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
static TypeId | GetTypeId () |
Register this type. | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. | |
Private Types | |
typedef std::vector< WifiPhyListener * > | Listeners |
typedef for a list of WifiPhyListeners | |
Private Member Functions | |
void | DoSwitchFromRx () |
Switch the state from RX. | |
void | LogPreviousIdleAndCcaBusyStates () |
Log the idle and CCA busy states. | |
void | NotifyCcaBusyStart (Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations) |
Notify all WifiPhyListener that the CCA has started for the given duration. | |
void | NotifyOff () |
Notify all WifiPhyListener that we are going to switch off. | |
void | NotifyOn () |
Notify all WifiPhyListener that we are going to switch on. | |
void | NotifyRxEndError () |
Notify all WifiPhyListener that the reception was not successful. | |
void | NotifyRxEndOk () |
Notify all WifiPhyListener that the reception was successful. | |
void | NotifyRxStart (Time duration) |
Notify all WifiPhyListener that the reception has started for the given duration. | |
void | NotifySleep () |
Notify all WifiPhyListener that we are going to sleep. | |
void | NotifySwitchingStart (Time duration) |
Notify all WifiPhyListener that we are switching channel with the given channel switching delay. | |
void | NotifyTxStart (Time duration, double txPowerDbm) |
Notify all WifiPhyListener that the transmission has started for the given duration. | |
void | NotifyWakeup () |
Notify all WifiPhyListener that we woke up. | |
Private Attributes | |
Time | m_endCcaBusy |
end CCA busy | |
Time | m_endRx |
end receive | |
Time | m_endSwitching |
end switching | |
Time | m_endTx |
end transmit | |
bool | m_isOff |
switched off | |
Listeners | m_listeners |
listeners | |
Time | m_previousStateChangeTime |
previous state change time | |
RxErrorCallback | m_rxErrorCallback |
receive error callback | |
TracedCallback< Ptr< const Packet >, double > | m_rxErrorTrace |
receive error trace callback | |
RxOkCallback | m_rxOkCallback |
receive OK callback | |
TracedCallback< Ptr< const Packet >, double, WifiMode, WifiPreamble > | m_rxOkTrace |
receive OK trace callback | |
bool | m_sleeping |
sleeping | |
Time | m_startCcaBusy |
start CCA busy | |
Time | m_startRx |
start receive | |
Time | m_startSleep |
start sleep | |
Time | m_startSwitching |
start switching | |
Time | m_startTx |
start transmit | |
TracedCallback< Time, Time, WifiPhyState > | m_stateLogger |
The trace source fired when state is changed. | |
TracedCallback< Ptr< const Packet >, WifiMode, WifiPreamble, uint8_t > | m_txTrace |
transmit trace callback | |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoDispose () |
Destructor implementation. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
This objects implements the PHY state machine of the Wifi device.
ns3::WifiPhyStateHelper is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
Size of this type is 224 bytes (on a 64-bit architecture).
Definition at line 68 of file wifi-phy-state-helper.h.
|
private |
typedef for a list of WifiPhyListeners
Definition at line 316 of file wifi-phy-state-helper.h.
typedef void(* ns3::WifiPhyStateHelper::RxEndErrorTracedCallback) (Ptr< const Packet > packet, double snr) |
TracedCallback signature for receive end error event.
[in] | packet | The received packet. |
[in] | snr | The SNR of the received packet in linear scale. |
Definition at line 297 of file wifi-phy-state-helper.h.
typedef void(* ns3::WifiPhyStateHelper::RxOkTracedCallback) (Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble) |
TracedCallback signature for receive end OK event.
[in] | packet | The received packet. |
[in] | snr | The SNR of the received packet in linear scale. |
[in] | mode | The transmission mode of the packet. |
[in] | preamble | The preamble of the packet. |
Definition at line 286 of file wifi-phy-state-helper.h.
typedef void(* ns3::WifiPhyStateHelper::StateTracedCallback) (Time start, Time duration, WifiPhyState state) |
TracedCallback signature for state changes.
[in] | start | Time when the state started. |
[in] | duration | Amount of time we've been in (or will be in) the state. |
[in] | state | The state. |
Definition at line 276 of file wifi-phy-state-helper.h.
typedef void(* ns3::WifiPhyStateHelper::TxTracedCallback) (Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t power) |
TracedCallback signature for transmit event.
[in] | packet | The received packet. |
[in] | mode | The transmission mode of the packet. |
[in] | preamble | The preamble of the packet. |
[in] | power | The transmit power level. |
Definition at line 307 of file wifi-phy-state-helper.h.
ns3::WifiPhyStateHelper::WifiPhyStateHelper | ( | ) |
Definition at line 68 of file wifi-phy-state-helper.cc.
References NS_LOG_FUNCTION.
|
private |
Switch the state from RX.
Definition at line 537 of file wifi-phy-state-helper.cc.
References IsStateCcaBusy(), IsStateIdle(), m_endRx, m_previousStateChangeTime, m_startRx, m_stateLogger, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by SwitchFromRxAbort(), SwitchFromRxEndError(), and SwitchFromRxEndOk().
Time ns3::WifiPhyStateHelper::GetDelayUntilIdle | ( | ) | const |
Return the time before the state is back to IDLE.
Definition at line 156 of file wifi-phy-state-helper.cc.
References GetState(), m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, Max, ns3::Simulator::Now(), NS_FATAL_ERROR, and ns3::Seconds().
Time ns3::WifiPhyStateHelper::GetLastRxEndTime | ( | ) | const |
Return the time the last RX end.
Definition at line 195 of file wifi-phy-state-helper.cc.
References m_endRx.
Time ns3::WifiPhyStateHelper::GetLastRxStartTime | ( | ) | const |
Return the time the last RX start.
Definition at line 189 of file wifi-phy-state-helper.cc.
References m_startRx.
WifiPhyState ns3::WifiPhyStateHelper::GetState | ( | ) | const |
Return the current state of WifiPhy.
Definition at line 201 of file wifi-phy-state-helper.cc.
References m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_isOff, m_sleeping, and ns3::Simulator::Now().
Referenced by GetDelayUntilIdle(), IsStateCcaBusy(), IsStateIdle(), IsStateOff(), IsStateRx(), IsStateSleep(), IsStateSwitching(), IsStateTx(), LogPreviousIdleAndCcaBusyStates(), SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), SwitchToSleep(), and SwitchToTx().
|
static |
Get the type ID.
Definition at line 42 of file wifi-phy-state-helper.cc.
References m_rxErrorTrace, m_rxOkTrace, m_stateLogger, m_txTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
bool ns3::WifiPhyStateHelper::IsStateCcaBusy | ( | ) | const |
Check whether the current state is CCA busy.
Definition at line 120 of file wifi-phy-state-helper.cc.
References GetState().
Referenced by DoSwitchFromRx(), SwitchFromRxAbort(), and SwitchToRx().
bool ns3::WifiPhyStateHelper::IsStateIdle | ( | ) | const |
Check whether the current state is IDLE.
Definition at line 114 of file wifi-phy-state-helper.cc.
References GetState().
Referenced by DoSwitchFromRx(), SwitchFromRxAbort(), and SwitchToRx().
bool ns3::WifiPhyStateHelper::IsStateOff | ( | ) | const |
Check whether the current state is OFF.
Definition at line 150 of file wifi-phy-state-helper.cc.
References GetState().
Referenced by SwitchFromOff(), and SwitchToOff().
bool ns3::WifiPhyStateHelper::IsStateRx | ( | ) | const |
Check whether the current state is RX.
Definition at line 126 of file wifi-phy-state-helper.cc.
References GetState().
Referenced by SwitchToRx().
bool ns3::WifiPhyStateHelper::IsStateSleep | ( | ) | const |
Check whether the current state is SLEEP.
Definition at line 144 of file wifi-phy-state-helper.cc.
References GetState().
Referenced by SwitchFromSleep(), and SwitchToSleep().
bool ns3::WifiPhyStateHelper::IsStateSwitching | ( | ) | const |
Check whether the current state is SWITCHING.
Definition at line 138 of file wifi-phy-state-helper.cc.
References GetState().
Referenced by SwitchToChannelSwitching().
bool ns3::WifiPhyStateHelper::IsStateTx | ( | ) | const |
Check whether the current state is TX.
Definition at line 132 of file wifi-phy-state-helper.cc.
References GetState().
|
private |
Log the idle and CCA busy states.
Definition at line 336 of file wifi-phy-state-helper.cc.
References GetState(), ns3::Time::IsStrictlyPositive(), m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_startCcaBusy, m_stateLogger, ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), SwitchToSleep(), and SwitchToTx().
|
private |
Notify all WifiPhyListener that the CCA has started for the given duration.
duration | the duration of the CCA state |
channelType | the channel type for which the CCA busy state is reported. |
per20MhzDurations | vector that indicates for how long each 20 MHz subchannel (corresponding to the index of the element in the vector) is busy and where a zero duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports 802.11ax or later and if the operational channel width is larger than 20 MHz. |
Definition at line 274 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchFromRxAbort(), and SwitchMaybeToCcaBusy().
|
private |
Notify all WifiPhyListener that we are going to switch off.
Definition at line 306 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchToOff().
|
private |
Notify all WifiPhyListener that we are going to switch on.
Definition at line 326 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchFromOff().
|
private |
Notify all WifiPhyListener that the reception was not successful.
Definition at line 264 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchFromRxEndError().
|
private |
Notify all WifiPhyListener that the reception was successful.
Definition at line 254 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchFromRxAbort(), and SwitchFromRxEndOk().
void ns3::WifiPhyStateHelper::NotifyRxMpdu | ( | Ptr< const WifiPsdu > | psdu, |
RxSignalInfo | rxSignalInfo, | ||
const WifiTxVector & | txVector | ||
) |
Notify the reception of an MPDU included in an A-MPDU.
psdu | the successfully received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TXVECTOR of the PSDU |
Definition at line 468 of file wifi-phy-state-helper.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_rxOkCallback, and NS_LOG_FUNCTION.
Handle the unsuccessful reception of a PSDU.
psdu | the PSDU that we failed to received |
snr | the SNR of the received PSDU in linear scale |
Definition at line 505 of file wifi-phy-state-helper.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_rxErrorCallback, m_rxErrorTrace, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::NotifyRxPsduSucceeded | ( | Ptr< const WifiPsdu > | psdu, |
RxSignalInfo | rxSignalInfo, | ||
const WifiTxVector & | txVector, | ||
uint16_t | staId, | ||
const std::vector< bool > & | statusPerMpdu | ||
) |
Handle the successful reception of a PSDU.
psdu | the successfully received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TXVECTOR of the PSDU |
staId | the station ID of the PSDU (only used for MU) |
statusPerMpdu | reception status per MPDU |
Definition at line 480 of file wifi-phy-state-helper.cc.
References ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetPreambleType(), ns3::Callback< R, UArgs >::IsNull(), m_rxOkCallback, m_rxOkTrace, NS_ASSERT, NS_LOG_FUNCTION, and ns3::RxSignalInfo::snr.
|
private |
Notify all WifiPhyListener that the reception has started for the given duration.
duration | the duration of the reception |
Definition at line 244 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchToRx().
|
private |
Notify all WifiPhyListener that we are going to sleep.
Definition at line 296 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchToSleep().
|
private |
Notify all WifiPhyListener that we are switching channel with the given channel switching delay.
duration | the delay to switch the channel |
Definition at line 286 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchToChannelSwitching().
Notify all WifiPhyListener that the transmission has started for the given duration.
duration | the duration of the transmission |
txPowerDbm | the nominal TX power in dBm |
Definition at line 234 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchToTx().
|
private |
Notify all WifiPhyListener that we woke up.
Definition at line 316 of file wifi-phy-state-helper.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by SwitchFromSleep().
void ns3::WifiPhyStateHelper::RegisterListener | ( | WifiPhyListener * | listener | ) |
Register WifiPhyListener to this WifiPhyStateHelper.
listener | the WifiPhyListener to register |
Definition at line 98 of file wifi-phy-state-helper.cc.
References m_listeners.
void ns3::WifiPhyStateHelper::SetReceiveErrorCallback | ( | RxErrorCallback | callback | ) |
Set a callback for a failed reception.
callback | the RxErrorCallback to set |
Definition at line 92 of file wifi-phy-state-helper.cc.
References m_rxErrorCallback.
void ns3::WifiPhyStateHelper::SetReceiveOkCallback | ( | RxOkCallback | callback | ) |
Set a callback for a successful reception.
callback | the RxOkCallback to set |
Definition at line 86 of file wifi-phy-state-helper.cc.
References m_rxOkCallback.
void ns3::WifiPhyStateHelper::SwitchFromOff | ( | ) |
Switch from off mode.
Definition at line 665 of file wifi-phy-state-helper.cc.
References IsStateOff(), m_isOff, m_previousStateChangeTime, NotifyOn(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchFromRxAbort | ( | uint16_t | operatingWidth | ) |
Abort current reception following a CCA reset request.
operatingWidth | the channel width the PHY is operating on (in MHz) |
Definition at line 611 of file wifi-phy-state-helper.cc.
References DoSwitchFromRx(), IsStateCcaBusy(), IsStateIdle(), m_endCcaBusy, NotifyCcaBusyStart(), NotifyRxEndOk(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Seconds(), and ns3::WIFI_CHANLIST_PRIMARY.
void ns3::WifiPhyStateHelper::SwitchFromRxEndError | ( | ) |
Switch from RX after the reception failed.
Definition at line 528 of file wifi-phy-state-helper.cc.
References DoSwitchFromRx(), m_endRx, NotifyRxEndError(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchFromRxEndOk | ( | ) |
Switch from RX after the reception was successful.
Definition at line 519 of file wifi-phy-state-helper.cc.
References DoSwitchFromRx(), m_endRx, NotifyRxEndOk(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchFromSleep | ( | ) |
Switch from sleep mode.
Definition at line 599 of file wifi-phy-state-helper.cc.
References IsStateSleep(), m_previousStateChangeTime, m_sleeping, m_startSleep, m_stateLogger, NotifyWakeup(), ns3::Simulator::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchMaybeToCcaBusy | ( | Time | duration, |
WifiChannelListType | channelType, | ||
const std::vector< Time > & | per20MhzDurations | ||
) |
Switch to CCA busy.
duration | the duration of the CCA state |
channelType | the channel type for which the CCA busy state is reported. |
per20MhzDurations | vector that indicates for how long each 20 MHz subchannel (corresponding to the index of the element in the vector) is busy and where a zero duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports 802.11ax or later and if the operational channel width is larger than 20 MHz. |
Definition at line 548 of file wifi-phy-state-helper.cc.
References GetState(), LogPreviousIdleAndCcaBusyStates(), m_endCcaBusy, m_startCcaBusy, NotifyCcaBusyStart(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and ns3::WIFI_CHANLIST_PRIMARY.
void ns3::WifiPhyStateHelper::SwitchToChannelSwitching | ( | Time | switchingDuration | ) |
Switch state to channel switching for the given duration.
switchingDuration | the duration of required to switch the channel |
Definition at line 435 of file wifi-phy-state-helper.cc.
References GetState(), IsStateSwitching(), ns3::Time::IsZero(), LogPreviousIdleAndCcaBusyStates(), m_endCcaBusy, m_endRx, m_endSwitching, m_previousStateChangeTime, m_startRx, m_startSwitching, m_stateLogger, NotifySwitchingStart(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchToOff | ( | ) |
Switch to off mode.
Definition at line 629 of file wifi-phy-state-helper.cc.
References GetState(), IsStateOff(), LogPreviousIdleAndCcaBusyStates(), m_endRx, m_endTx, m_isOff, m_previousStateChangeTime, m_startRx, m_startTx, m_stateLogger, NotifyOff(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchToRx | ( | Time | rxDuration | ) |
Switch state to RX for the given duration.
rxDuration | the duration of the RX |
Definition at line 411 of file wifi-phy-state-helper.cc.
References GetState(), IsStateCcaBusy(), IsStateIdle(), IsStateRx(), LogPreviousIdleAndCcaBusyStates(), m_endRx, m_previousStateChangeTime, m_startRx, NotifyRxStart(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchToSleep | ( | ) |
Switch to sleep mode.
Definition at line 576 of file wifi-phy-state-helper.cc.
References GetState(), IsStateSleep(), LogPreviousIdleAndCcaBusyStates(), m_previousStateChangeTime, m_sleeping, m_startSleep, NotifySleep(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::SwitchToTx | ( | Time | txDuration, |
WifiConstPsduMap | psdus, | ||
double | txPowerDbm, | ||
const WifiTxVector & | txVector | ||
) |
Switch state to TX for the given duration.
txDuration | the duration of the PPDU to transmit |
psdus | the PSDUs in the transmitted PPDU (only one unless it is a MU PPDU) |
txPowerDbm | the nominal TX power in dBm |
txVector | the TX vector for the transmission |
Definition at line 368 of file wifi-phy-state-helper.cc.
References ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetPreambleType(), GetState(), ns3::WifiTxVector::GetTxPowerLevel(), LogPreviousIdleAndCcaBusyStates(), m_endRx, m_endTx, m_previousStateChangeTime, m_startRx, m_startTx, m_stateLogger, m_txTrace, NotifyTxStart(), ns3::Simulator::Now(), NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::WifiPhyStateHelper::UnregisterListener | ( | WifiPhyListener * | listener | ) |
Remove WifiPhyListener from this WifiPhyStateHelper.
listener | the WifiPhyListener to unregister |
Definition at line 104 of file wifi-phy-state-helper.cc.
References m_listeners.
|
private |
end CCA busy
Definition at line 394 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), GetState(), LogPreviousIdleAndCcaBusyStates(), SwitchFromRxAbort(), SwitchMaybeToCcaBusy(), and SwitchToChannelSwitching().
|
private |
end receive
Definition at line 393 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetDelayUntilIdle(), GetLastRxEndTime(), GetState(), LogPreviousIdleAndCcaBusyStates(), SwitchFromRxEndError(), SwitchFromRxEndOk(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), and SwitchToTx().
|
private |
end switching
Definition at line 395 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), GetState(), LogPreviousIdleAndCcaBusyStates(), and SwitchToChannelSwitching().
|
private |
end transmit
Definition at line 392 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), GetState(), LogPreviousIdleAndCcaBusyStates(), SwitchToOff(), and SwitchToTx().
|
private |
switched off
Definition at line 391 of file wifi-phy-state-helper.h.
Referenced by GetState(), SwitchFromOff(), and SwitchToOff().
|
private |
listeners
Definition at line 403 of file wifi-phy-state-helper.h.
Referenced by NotifyCcaBusyStart(), NotifyOff(), NotifyOn(), NotifyRxEndError(), NotifyRxEndOk(), NotifyRxStart(), NotifySleep(), NotifySwitchingStart(), NotifyTxStart(), NotifyWakeup(), RegisterListener(), and UnregisterListener().
|
private |
previous state change time
Definition at line 401 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), SwitchFromOff(), SwitchFromSleep(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), SwitchToSleep(), and SwitchToTx().
|
private |
receive error callback
Definition at line 410 of file wifi-phy-state-helper.h.
Referenced by NotifyRxPsduFailed(), and SetReceiveErrorCallback().
|
private |
receive error trace callback
Definition at line 406 of file wifi-phy-state-helper.h.
Referenced by GetTypeId(), and NotifyRxPsduFailed().
|
private |
receive OK callback
Definition at line 409 of file wifi-phy-state-helper.h.
Referenced by NotifyRxMpdu(), NotifyRxPsduSucceeded(), and SetReceiveOkCallback().
|
private |
receive OK trace callback
Definition at line 405 of file wifi-phy-state-helper.h.
Referenced by GetTypeId(), and NotifyRxPsduSucceeded().
|
private |
sleeping
Definition at line 390 of file wifi-phy-state-helper.h.
Referenced by GetState(), SwitchFromSleep(), and SwitchToSleep().
|
private |
start CCA busy
Definition at line 398 of file wifi-phy-state-helper.h.
Referenced by LogPreviousIdleAndCcaBusyStates(), and SwitchMaybeToCcaBusy().
|
private |
start receive
Definition at line 397 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetLastRxStartTime(), SwitchToChannelSwitching(), SwitchToOff(), SwitchToRx(), and SwitchToTx().
|
private |
start sleep
Definition at line 400 of file wifi-phy-state-helper.h.
Referenced by SwitchFromSleep(), and SwitchToSleep().
|
private |
start switching
Definition at line 399 of file wifi-phy-state-helper.h.
Referenced by SwitchToChannelSwitching().
|
private |
start transmit
Definition at line 396 of file wifi-phy-state-helper.h.
Referenced by SwitchToOff(), and SwitchToTx().
|
private |
The trace source fired when state is changed.
Definition at line 388 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetTypeId(), LogPreviousIdleAndCcaBusyStates(), SwitchFromSleep(), SwitchToChannelSwitching(), SwitchToOff(), and SwitchToTx().
|
private |
transmit trace callback
Definition at line 408 of file wifi-phy-state-helper.h.
Referenced by GetTypeId(), and SwitchToTx().