#include <wifi-phy-state-helper.h>
Public Member Functions | |
WifiPhyStateHelper () | |
Time | GetDelayUntilIdle (void) |
Time | GetLastRxStartTime (void) const |
enum WifiPhy::State | GetState (void) |
Time | GetStateDuration (void) |
bool | IsStateBusy (void) |
bool | IsStateCcaBusy (void) |
bool | IsStateIdle (void) |
bool | IsStateRx (void) |
bool | IsStateSwitching (void) |
bool | IsStateTx (void) |
void | RegisterListener (WifiPhyListener *listener) |
void | SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback) |
void | SetReceiveOkCallback (WifiPhy::RxOkCallback callback) |
void | SwitchFromRxEndError (Ptr< const Packet > packet, double snr) |
void | SwitchFromRxEndOk (Ptr< Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble) |
void | SwitchMaybeToCcaBusy (Time duration) |
void | SwitchToChannelSwitching (Time switchingDuration) |
void | SwitchToRx (Time rxDuration) |
void | SwitchToTx (Time txDuration, Ptr< const Packet > packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower) |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Public Attributes | |
TracedCallback< Time, Time, enum WifiPhy::State > | m_stateLogger |
Private Types | |
typedef std::vector < WifiPhyListener * > | Listeners |
Private Member Functions | |
void | DoSwitchFromRx (void) |
void | LogPreviousIdleAndCcaBusyStates (void) |
void | NotifyMaybeCcaBusyStart (Time duration) |
void | NotifyRxEndError (void) |
void | NotifyRxEndOk (void) |
void | NotifyRxStart (Time duration) |
void | NotifySwitchingStart (Time duration) |
void | NotifyTxStart (Time duration) |
void | NotifyWakeup (void) |
Private Attributes | |
Time | m_endCcaBusy |
Time | m_endRx |
Time | m_endSwitching |
Time | m_endTx |
Listeners | m_listeners |
Time | m_previousStateChangeTime |
WifiPhy::RxErrorCallback | m_rxErrorCallback |
TracedCallback< Ptr< const Packet >, double > | m_rxErrorTrace |
bool | m_rxing |
WifiPhy::RxOkCallback | m_rxOkCallback |
TracedCallback< Ptr< const Packet >, double, WifiMode, enum WifiPreamble > | m_rxOkTrace |
Time | m_startCcaBusy |
Time | m_startRx |
Time | m_startSwitching |
Time | m_startTx |
TracedCallback< Ptr< const Packet >, WifiMode, WifiPreamble, uint8_t > | m_txTrace |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoInitialize (void) |
virtual void | NotifyNewAggregate (void) |
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.
Definition at line 35 of file wifi-phy-state-helper.h.
|
private |
Definition at line 65 of file wifi-phy-state-helper.h.
ns3::WifiPhyStateHelper::WifiPhyStateHelper | ( | ) |
Definition at line 52 of file wifi-phy-state-helper.cc.
References NS_LOG_FUNCTION.
|
private |
Definition at line 392 of file wifi-phy-state-helper.cc.
References IsStateCcaBusy(), IsStateIdle(), IsStateRx(), m_previousStateChangeTime, m_rxing, m_startRx, m_stateLogger, ns3::Now(), NS_ASSERT, and ns3::WifiPhy::RX.
Referenced by SwitchFromRxEndError(), and SwitchFromRxEndOk().
Time ns3::WifiPhyStateHelper::GetDelayUntilIdle | ( | void | ) |
Definition at line 123 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, GetState(), ns3::WifiPhy::IDLE, m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, ns3::Max(), ns3::Now(), NS_FATAL_ERROR, ns3::WifiPhy::RX, ns3::Seconds(), ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
Referenced by ns3::YansWifiPhy::GetDelayUntilIdle(), and ns3::YansWifiPhy::StartReceivePacket().
Time ns3::WifiPhyStateHelper::GetLastRxStartTime | ( | void | ) | const |
Definition at line 154 of file wifi-phy-state-helper.cc.
References m_startRx.
Referenced by ns3::YansWifiPhy::GetLastRxStartTime().
enum WifiPhy::State ns3::WifiPhyStateHelper::GetState | ( | void | ) |
Definition at line 160 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, ns3::IDLE, m_endCcaBusy, m_endSwitching, m_endTx, m_rxing, ns3::Simulator::Now(), ns3::WifiPhy::RX, ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
Referenced by GetDelayUntilIdle(), IsStateBusy(), IsStateCcaBusy(), IsStateIdle(), IsStateRx(), IsStateSwitching(), IsStateTx(), ns3::YansWifiPhy::SetChannelNumber(), ns3::YansWifiPhy::StartReceivePacket(), SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
Time ns3::WifiPhyStateHelper::GetStateDuration | ( | void | ) |
Definition at line 117 of file wifi-phy-state-helper.cc.
References m_previousStateChangeTime, and ns3::Now().
Referenced by ns3::YansWifiPhy::GetStateDuration().
|
static |
Reimplemented from ns3::Object.
Definition at line 32 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::IsStateBusy | ( | void | ) |
Definition at line 89 of file wifi-phy-state-helper.cc.
References GetState(), and ns3::WifiPhy::IDLE.
Referenced by ns3::YansWifiPhy::IsStateBusy().
bool ns3::WifiPhyStateHelper::IsStateCcaBusy | ( | void | ) |
Definition at line 94 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, and GetState().
Referenced by DoSwitchFromRx(), ns3::YansWifiPhy::IsStateCcaBusy(), and SwitchToRx().
bool ns3::WifiPhyStateHelper::IsStateIdle | ( | void | ) |
Definition at line 84 of file wifi-phy-state-helper.cc.
References GetState(), and ns3::WifiPhy::IDLE.
Referenced by DoSwitchFromRx(), ns3::YansWifiPhy::IsStateIdle(), and SwitchToRx().
bool ns3::WifiPhyStateHelper::IsStateRx | ( | void | ) |
Definition at line 99 of file wifi-phy-state-helper.cc.
References GetState(), and ns3::WifiPhy::RX.
Referenced by DoSwitchFromRx(), ns3::YansWifiPhy::IsStateRx(), ns3::YansWifiPhy::SendPacket(), and SwitchToRx().
bool ns3::WifiPhyStateHelper::IsStateSwitching | ( | void | ) |
Definition at line 109 of file wifi-phy-state-helper.cc.
References GetState(), and ns3::WifiPhy::SWITCHING.
Referenced by ns3::YansWifiPhy::IsStateSwitching(), ns3::YansWifiPhy::SendPacket(), and SwitchToChannelSwitching().
bool ns3::WifiPhyStateHelper::IsStateTx | ( | void | ) |
Definition at line 104 of file wifi-phy-state-helper.cc.
References GetState(), and ns3::WifiPhy::TX.
Referenced by ns3::YansWifiPhy::IsStateTx(), and ns3::YansWifiPhy::SendPacket().
|
private |
Definition at line 235 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, ns3::WifiPhy::IDLE, m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_startCcaBusy, m_stateLogger, ns3::Max(), ns3::Now(), and NS_ASSERT.
Referenced by SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 218 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by SwitchMaybeToCcaBusy().
|
private |
Definition at line 210 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by SwitchFromRxEndError().
|
private |
Definition at line 202 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by SwitchFromRxEndOk().
|
private |
Definition at line 194 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by SwitchToRx().
|
private |
Definition at line 226 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by SwitchToChannelSwitching().
|
private |
Definition at line 186 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by SwitchToTx().
|
private |
void ns3::WifiPhyStateHelper::RegisterListener | ( | WifiPhyListener * | listener | ) |
Definition at line 78 of file wifi-phy-state-helper.cc.
References m_listeners.
Referenced by ns3::YansWifiPhy::RegisterListener().
void ns3::WifiPhyStateHelper::SetReceiveErrorCallback | ( | WifiPhy::RxErrorCallback | callback | ) |
Definition at line 73 of file wifi-phy-state-helper.cc.
References m_rxErrorCallback.
Referenced by ns3::YansWifiPhy::SetReceiveErrorCallback().
void ns3::WifiPhyStateHelper::SetReceiveOkCallback | ( | WifiPhy::RxOkCallback | callback | ) |
Definition at line 68 of file wifi-phy-state-helper.cc.
References m_rxOkCallback.
Referenced by ns3::YansWifiPhy::SetReceiveOkCallback().
Definition at line 380 of file wifi-phy-state-helper.cc.
References DoSwitchFromRx(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_rxErrorCallback, m_rxErrorTrace, and NotifyRxEndError().
Referenced by ns3::YansWifiPhy::EndReceive().
void ns3::WifiPhyStateHelper::SwitchFromRxEndOk | ( | Ptr< Packet > | packet, |
double | snr, | ||
WifiMode | mode, | ||
enum WifiPreamble | preamble | ||
) |
Definition at line 368 of file wifi-phy-state-helper.cc.
References DoSwitchFromRx(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_rxOkCallback, m_rxOkTrace, and NotifyRxEndOk().
Referenced by ns3::YansWifiPhy::EndReceive().
void ns3::WifiPhyStateHelper::SwitchMaybeToCcaBusy | ( | Time | duration | ) |
Definition at line 405 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, GetState(), ns3::WifiPhy::IDLE, LogPreviousIdleAndCcaBusyStates(), m_endCcaBusy, m_startCcaBusy, NotifyMaybeCcaBusyStart(), ns3::Now(), ns3::WifiPhy::RX, ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
Referenced by ns3::YansWifiPhy::StartReceivePacket().
void ns3::WifiPhyStateHelper::SwitchToChannelSwitching | ( | Time | switchingDuration | ) |
Definition at line 324 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, GetState(), ns3::WifiPhy::IDLE, IsStateSwitching(), LogPreviousIdleAndCcaBusyStates(), m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_previousStateChangeTime, m_rxing, m_startCcaBusy, m_startRx, m_startSwitching, m_stateLogger, ns3::Max(), NotifySwitchingStart(), ns3::Now(), NS_ASSERT, NS_FATAL_ERROR, ns3::WifiPhy::RX, ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
Referenced by ns3::YansWifiPhy::SetChannelNumber().
void ns3::WifiPhyStateHelper::SwitchToRx | ( | Time | rxDuration | ) |
Definition at line 292 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, GetState(), ns3::WifiPhy::IDLE, IsStateCcaBusy(), IsStateIdle(), IsStateRx(), LogPreviousIdleAndCcaBusyStates(), m_endRx, m_endSwitching, m_endTx, m_previousStateChangeTime, m_rxing, m_startCcaBusy, m_startRx, m_stateLogger, ns3::Max(), NotifyRxStart(), ns3::Now(), NS_ASSERT, NS_FATAL_ERROR, ns3::WifiPhy::RX, ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
Referenced by ns3::YansWifiPhy::StartReceivePacket().
void ns3::WifiPhyStateHelper::SwitchToTx | ( | Time | txDuration, |
Ptr< const Packet > | packet, | ||
WifiMode | txMode, | ||
WifiPreamble | preamble, | ||
uint8_t | txPower | ||
) |
Definition at line 255 of file wifi-phy-state-helper.cc.
References ns3::WifiPhy::CCA_BUSY, GetState(), ns3::WifiPhy::IDLE, LogPreviousIdleAndCcaBusyStates(), m_endRx, m_endSwitching, m_endTx, m_previousStateChangeTime, m_rxing, m_startCcaBusy, m_startRx, m_startTx, m_stateLogger, m_txTrace, ns3::Max(), NotifyTxStart(), ns3::Now(), NS_FATAL_ERROR, ns3::WifiPhy::RX, ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
Referenced by ns3::YansWifiPhy::SendPacket().
|
private |
Definition at line 81 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), GetState(), LogPreviousIdleAndCcaBusyStates(), SwitchMaybeToCcaBusy(), and SwitchToChannelSwitching().
|
private |
Definition at line 80 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), LogPreviousIdleAndCcaBusyStates(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 82 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), GetState(), LogPreviousIdleAndCcaBusyStates(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 79 of file wifi-phy-state-helper.h.
Referenced by GetDelayUntilIdle(), GetState(), LogPreviousIdleAndCcaBusyStates(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 89 of file wifi-phy-state-helper.h.
Referenced by NotifyMaybeCcaBusyStart(), NotifyRxEndError(), NotifyRxEndOk(), NotifyRxStart(), NotifySwitchingStart(), NotifyTxStart(), and RegisterListener().
|
private |
Definition at line 87 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetStateDuration(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 94 of file wifi-phy-state-helper.h.
Referenced by SetReceiveErrorCallback(), and SwitchFromRxEndError().
|
private |
Definition at line 91 of file wifi-phy-state-helper.h.
Referenced by GetTypeId(), and SwitchFromRxEndError().
|
private |
Definition at line 78 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetState(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 93 of file wifi-phy-state-helper.h.
Referenced by SetReceiveOkCallback(), and SwitchFromRxEndOk().
|
private |
Definition at line 90 of file wifi-phy-state-helper.h.
Referenced by GetTypeId(), and SwitchFromRxEndOk().
|
private |
Definition at line 85 of file wifi-phy-state-helper.h.
Referenced by LogPreviousIdleAndCcaBusyStates(), SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 84 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetLastRxStartTime(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 86 of file wifi-phy-state-helper.h.
Referenced by SwitchToChannelSwitching().
|
private |
Definition at line 83 of file wifi-phy-state-helper.h.
Referenced by SwitchToTx().
TracedCallback<Time,Time,enum WifiPhy::State> ns3::WifiPhyStateHelper::m_stateLogger |
Definition at line 63 of file wifi-phy-state-helper.h.
Referenced by DoSwitchFromRx(), GetTypeId(), LogPreviousIdleAndCcaBusyStates(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().
|
private |
Definition at line 92 of file wifi-phy-state-helper.h.
Referenced by GetTypeId(), and SwitchToTx().