21 #ifndef WIFI_PHY_STATE_HELPER_H
22 #define WIFI_PHY_STATE_HELPER_H
25 #include "ns3/traced-callback.h"
26 #include "ns3/object.h"
Simulation virtual time values and global simulation resolution.
void DoSwitchFromRx(void)
Switch the state from RX.
Time GetStateDuration(void)
Return the elapsed time of the current state.
void SwitchFromRxEndOk(Ptr< Packet > packet, double snr, WifiTxVector txVector, enum WifiPreamble preamble)
Switch from RX after the reception was successful.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void NotifyWakeup(void)
Notify all WifiPhyListener that we woke up.
void(* StateTracedCallback)(Time start, Time duration, WifiPhy::State state)
TracedCallback signature for state changes.
Forward calls to a chain of Callback.
void SwitchToChannelSwitching(Time switchingDuration)
Switch state to channel switching for the given duration.
void UnregisterListener(WifiPhyListener *listener)
Remove WifiPhyListener from this WifiPhyStateHelper.
void NotifyRxEndError(void)
Notify all WifiPhyListener that the reception was not successful.
std::vector< WifiPhyListener * >::iterator ListenersI
void SetReceiveOkCallback(WifiPhy::RxOkCallback callback)
Set a callback for a successful reception.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
void SwitchFromSleep(Time duration)
Switch from sleep mode.
std::vector< WifiPhyListener * > Listeners
typedef for a list of WifiPhyListeners
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
bool IsStateIdle(void)
Check whether the current state is IDLE.
Time GetDelayUntilIdle(void)
Return the time before the state is back to IDLE.
void NotifySleep(void)
Notify all WifiPhyListener that we are going to sleep.
TracedCallback< Ptr< const Packet >, double, WifiMode, enum WifiPreamble > m_rxOkTrace
bool IsStateSwitching(void)
Check whether the current state is SWITCHING.
void(* RxOkTracedCallback)(Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble)
TracedCallback signature for receive end ok event.
receive notifications about phy events.
void NotifySwitchingStart(Time duration)
Notify all WifiPhyListener that we are switching channel with the given channel switching delay...
bool IsStateRx(void)
Check whether the current state is RX.
Time m_previousStateChangeTime
void SetReceiveErrorCallback(WifiPhy::RxErrorCallback callback)
Set a callback for a failed reception.
void(* TxTracedCallback)(Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t power)
TracedCallback signature for transmit event.
bool IsStateSleep(void)
Check whether the current state is SLEEP.
void NotifyMaybeCcaBusyStart(Time duration)
Notify all WifiPhyListener that the CCA has started for the given duration.
WifiPhy::RxErrorCallback m_rxErrorCallback
void SwitchToSleep(void)
Switch to sleep mode.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SwitchFromRxEndError(Ptr< const Packet > packet, double snr)
Switch from RX after the reception failed.
void NotifyTxStart(Time duration, double txPowerDbm)
Notify all WifiPhyListener that the transmission has started for the given duration.
void NotifyRxEndOk(void)
Notify all WifiPhyListener that the reception was successful.
static TypeId GetTypeId(void)
TracedCallback< Time, Time, enum WifiPhy::State > m_stateLogger
enum WifiPhy::State GetState(void)
Return the current state of WifiPhy.
bool IsStateBusy(void)
Check whether the current state is not IDLE.
This objects implements the PHY state machine of the Wifi device.
bool IsStateCcaBusy(void)
Check whether the current state is CCA busy.
TracedCallback< Ptr< const Packet >, WifiMode, WifiPreamble, uint8_t > m_txTrace
void(* RxEndErrorTracedCallback)(Ptr< const Packet > packet, double snr)
TracedCallback signature for receive end error event.
TracedCallback< Ptr< const Packet >, double > m_rxErrorTrace
bool IsStateTx(void)
Check whether the current state is TX.
A base class which provides memory management and object aggregation.
void SwitchToRx(Time rxDuration)
Switch state to RX for the given duration.
void LogPreviousIdleAndCcaBusyStates(void)
Log the ideal and CCA states.
Time GetLastRxStartTime(void) const
Return the time the last RX start.
State
The state of the PHY layer.
void NotifyRxStart(Time duration)
Notify all WifiPhyListener that the reception has started for the given duration. ...
a unique identifier for an interface.
void RegisterListener(WifiPhyListener *listener)
Register WifiPhyListener to this WifiPhyStateHelper.
void SwitchMaybeToCcaBusy(Time duration)
Switch to CCA busy.
void SwitchToTx(Time txDuration, Ptr< const Packet > packet, double txPowerDbm, WifiTxVector txVector, WifiPreamble preamble)
Switch state to TX for the given duration.
WifiPhy::RxOkCallback m_rxOkCallback