21 #include "ns3/simulator.h"
22 #include "ns3/packet.h"
27 #include "ns3/packet-burst.h"
28 #include "ns3/trace-source-accessor.h"
29 #include "ns3/pointer.h"
30 #include "ns3/uinteger.h"
31 #include "ns3/double.h"
43 .AddAttribute (
"Channel",
47 MakePointerChecker<WimaxChannel> ())
49 .AddAttribute (
"FrameDuration",
50 "The frame duration in seconds.",
55 .AddAttribute (
"Frequency",
56 "The central frequency in KHz.",
59 MakeUintegerChecker<uint32_t> (1000000, 11000000))
61 .AddAttribute (
"Bandwidth",
62 "The channel bandwidth in Hz.",
65 MakeUintegerChecker<uint32_t> (5000000, 30000000))
72 : m_state (PHY_STATE_IDLE),
74 m_frameDuration (
Seconds (0.01)),
75 m_frequency (5000000),
76 m_channelBandwidth (10000000),
130 "Error while scanning: The PHY state should be PHY_STATE_SCANNING or PHY_STATE_IDLE");
Time GetPsDuration(void) const
virtual uint16_t DoGetTtg(void) const =0
Simulation virtual time values and global simulation resolution.
Callback< void, Ptr< const PacketBurst > > GetReceiveCallback(void) const
Smart pointer class similar to boost::intrusive_ptr.
virtual double DoGetSamplingFactor(void) const =0
void SetFrequency(uint32_t frequency)
set the frequency on which the device should lock
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetFrameDuration(Time frameDuration)
Set the frame duration.
virtual void DoAttach(Ptr< WimaxChannel > channel)=0
virtual void DoDispose(void)
Destructor implementation.
virtual uint8_t DoGetFrameDurationCode(void) const =0
bool IsDuplex(void) const
uint32_t GetChannelBandwidth(void) const
uint32_t GetSymbolsPerFrame(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< WimaxChannel > m_channel
void SetSimplex(uint64_t frequency)
configure the physical layer in simplex mode
uint64_t GetRxFrequency(void) const
double GetSamplingFactor(void) const
Time GetSymbolDuration(void) const
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
virtual Time DoGetTransmissionTime(uint32_t size, ModulationType modulationType) const =0
void SetSymbolsPerFrame(uint32_t symbolsPerFrame)
set the number of symbols per frame
void SetPsDuration(Time psDuration)
set the physical slot duration in seconds
Time GetFrameDuration(void) const
void SetReceiveCallback(Callback< void, Ptr< const PacketBurst > > callback)
set the callback function to call when a burst is received
Time GetTransmissionTime(uint32_t size, ModulationType modulationType) const
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual uint16_t DoGetRtg(void) const =0
virtual uint32_t DoGetDataRate(ModulationType modulationType) const =0
uint16_t GetTtg(void) const
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t m_channelBandwidth
AttributeValue implementation for Time.
void SetScanningCallback(void) const
calls the scanning call back function
uint16_t GetNfft(void) const
Hold an unsigned integer type.
void SetPsPerSymbol(uint16_t psPerSymbol)
set the number of physical slots per symbol
uint64_t GetNrSymbols(uint32_t size, ModulationType modulationType) const
static TypeId GetTypeId(void)
Ptr< WimaxChannel > GetChannel(void) const
virtual uint16_t DoGetNfft(void) const =0
virtual uint64_t DoGetNrBytes(uint32_t symbols, ModulationType modulationType) const =0
Time GetFrameDurationSec(void) const
uint8_t GetNrCarriers(void) const
Callback< void, bool, uint64_t > m_scanningCallback
double GetGValue(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr.
void SetChannelBandwidth(uint32_t channelBandwidth)
Set the channel bandwidth.
uint32_t m_symbolsPerFrame
uint64_t GetNrBytes(uint32_t symbols, ModulationType modulationType) const
uint16_t GetPsPerSymbol(void) const
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual uint64_t DoGetNrSymbols(uint32_t size, ModulationType modulationType) const =0
void StartScanning(uint64_t frequency, Time timeout, Callback< void, bool, uint64_t > callback)
scan the frequency frequency for maximum timeout seconds and calls callback if the frequency could be...
Ptr< NetDevice > GetDevice(void) const
Callback< void, Ptr< const PacketBurst > > m_rxCallback
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void Attach(Ptr< WimaxChannel > channel)
Attach the physical layer to a channel.
void SetSymbolDuration(Time symbolDuration)
set the OFMD symbol duration in second
uint16_t GetPsPerFrame(void) const
uint8_t GetFrameDurationCode(void) const
An identifier for simulation events.
virtual Ptr< Object > GetMobility(void)
void SetDuplex(uint64_t rxFrequency, uint64_t txFrequency)
configure the physical layer in duplex mode
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetDevice(Ptr< WimaxNetDevice > device)
Set the device in which this physical layer is installed.
void SetState(PhyState state)
set the state of the device
uint16_t GetRtg(void) const
void SetDataRates(void)
calculates the data rate of each modulation and save them for future use
uint32_t GetDataRate(ModulationType modulationType) const
void SetNrCarriers(uint8_t nrCarriers)
Set the number of carriers in the physical frame.
Ptr< WimaxNetDevice > m_device
double GetSamplingFrequency(void) const
uint64_t GetTxFrequency(void) const
A base class which provides memory management and object aggregation.
virtual void DoSetDataRates(void)=0
EventId GetChnlSrchTimeoutEvent(void) const
void SetPsPerFrame(uint16_t psPerFrame)
set the number of physical slot per frame
uint32_t GetFrequency(void) const
virtual double DoGetGValue(void) const =0
void SetPhyParameters(void)
computes the Physical parameters and store them
virtual double DoGetSamplingFrequency(void) const =0
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
EventId m_dlChnlSrchTimeoutEvent
virtual void SetMobility(Ptr< Object > mobility)
set the mobility model of the device
PhyState GetState(void) const
uint64_t GetScanningFrequency(void) const
virtual void DoSetPhyParameters(void)=0
virtual Time DoGetFrameDuration(uint8_t frameDurationCode) const =0
uint64_t m_scanningFrequency