Public Types | Public Member Functions | Static Public Member Functions

ns3::WifiPhy Class Reference

802.11 PHY layer model More...

#include <wifi-phy.h>

Inheritance diagram for ns3::WifiPhy:
Inheritance graph
[legend]
Collaboration diagram for ns3::WifiPhy:
Collaboration graph
[legend]

List of all members.

Public Types

enum  State { SYNC, TX, CCA_BUSY, IDLE }
typedef Callback< void, Ptr
< Packet >, double, WifiMode,
enum WifiPreamble > 
SyncOkCallback
typedef Callback< void, Ptr
< const Packet >, double > 
SyncErrorCallback

Public Member Functions

virtual uint32_t GetNTxPower (void) const =0
virtual void SetReceiveOkCallback (SyncOkCallback callback)=0
virtual void SetReceiveErrorCallback (SyncErrorCallback callback)=0
virtual void SendPacket (Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel)=0
virtual void RegisterListener (WifiPhyListener *listener)=0
virtual bool IsStateCcaBusy (void)=0
virtual bool IsStateIdle (void)=0
virtual bool IsStateBusy (void)=0
virtual bool IsStateSync (void)=0
virtual bool IsStateTx (void)=0
virtual Time GetStateDuration (void)=0
virtual Time GetDelayUntilIdle (void)=0
virtual Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const =0
virtual uint32_t GetNModes (void) const =0
virtual WifiMode GetMode (uint32_t mode) const =0
virtual double CalculateSnr (WifiMode txMode, double ber) const =0

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::WifiPhy.

Detailed Description

802.11 PHY layer model


Member Typedef Documentation

typedef Callback<void,Ptr<const Packet>, double> ns3::WifiPhy::SyncErrorCallback

arg1: packet received unsuccessfully arg2: snr of packet

typedef Callback<void,Ptr<Packet>, double, WifiMode, enum WifiPreamble> ns3::WifiPhy::SyncOkCallback

arg1: packet received successfully arg2: snr of packet arg3: mode of packet arg4: type of preamble used for packet.


Member Enumeration Documentation

The state of the PHY layer.

Enumerator:
SYNC 

The PHY layer is synchronized upon a packet.

TX 

The PHY layer is sending a packet.

CCA_BUSY 

The PHY layer has sense the medium busy through the CCA mechanism

IDLE 

The PHY layer is IDLE.


Member Function Documentation

virtual double ns3::WifiPhy::CalculateSnr ( WifiMode  txMode,
double  ber 
) const [pure virtual]
Parameters:
txMode the transmission mode
ber the probability of bit error rate
Returns:
the minimum snr which is required to achieve the requested ber for the specified transmission mode. (W/W)

Implemented in ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::CalculateTxDuration ( uint32_t  size,
WifiMode  payloadMode,
enum WifiPreamble  preamble 
) const [pure virtual]
Parameters:
size the number of bytes in the packet to send
payloadMode the transmission mode to use for this packet
preamble the type of preamble to use for this packet.
Returns:
the total amount of time this PHY will stay busy for the transmission of these bytes.

Implemented in ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::GetDelayUntilIdle ( void   )  [pure virtual]
Returns:
the predicted delay until this PHY can become WifiPhy::IDLE.

The PHY will never become WifiPhy::IDLE _before_ the delay returned by this method but it could become really idle later.

Implemented in ns3::YansWifiPhy.

virtual WifiMode ns3::WifiPhy::GetMode ( uint32_t  mode  )  const [pure virtual]
Parameters:
mode index in array of supported modes
Returns:
the mode whose index is specified.

Implemented in ns3::YansWifiPhy.

virtual uint32_t ns3::WifiPhy::GetNModes ( void   )  const [pure virtual]
Returns:
the number of transmission modes supported by this PHY.

Implemented in ns3::YansWifiPhy.

virtual uint32_t ns3::WifiPhy::GetNTxPower ( void   )  const [pure virtual]
Returns:
the number of tx power levels available for this PHY.

Implemented in ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::GetStateDuration ( void   )  [pure virtual]
Returns:
the amount of time since the current state has started.

Implemented in ns3::YansWifiPhy.

static TypeId ns3::WifiPhy::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::WifiPhy.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3WifiNetDevice/Phy

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

Reimplemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateBusy ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is not WifiPhy::IDLE, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateCcaBusy ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::CCA_BUSY, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateIdle ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::IDLE, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateSync ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::SYNC, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateTx ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::TX, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::RegisterListener ( WifiPhyListener listener  )  [pure virtual]
Parameters:
listener the new listener

Add the input listener to the list of objects to be notified of PHY-level events.

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SendPacket ( Ptr< const Packet packet,
WifiMode  mode,
enum WifiPreamble  preamble,
uint8_t  txPowerLevel 
) [pure virtual]
Parameters:
packet the packet to send
mode the transmission mode to use to send this packet
preamble the type of preamble to use to send this packet.
txPowerLevel a power level to use to send this packet. The real transmission power is calculated as txPowerMin + txPowerLevel * (txPowerMax - txPowerMin) / nTxLevels

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SetReceiveErrorCallback ( SyncErrorCallback  callback  )  [pure virtual]
Parameters:
callback the callback to invoke upon erronous packet reception.

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SetReceiveOkCallback ( SyncOkCallback  callback  )  [pure virtual]
Parameters:
callback the callback to invoke upon successful packet reception.

Implemented in ns3::YansWifiPhy.


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