|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #include <ns3/component-carrier.h>
24 #include <ns3/string.h>
26 #include <ns3/abort.h>
27 #include <ns3/pointer.h>
29 #include <ns3/uinteger.h>
30 #include <ns3/lte-spectrum-value-helper.h>
58 .AddConstructor<CcHelper> ()
59 .AddAttribute (
"NumberOfComponentCarriers",
60 "Set the number of Component Carriers to setup per eNodeB"
61 "Currently the maximum Number of Component Carriers allowed is 2",
65 .AddAttribute (
"UlEarfcn",
66 "Set Ul Channel [EARFCN] for the first carrier component",
69 MakeUintegerChecker<uint32_t> ())
70 .AddAttribute (
"DlEarfcn",
71 "Set Dl Channel [EARFCN] for the first carrier component",
74 MakeUintegerChecker<uint32_t> (0))
75 .AddAttribute (
"DlBandwidth",
76 "Set Dl Bandwidth for the first carrier component",
79 MakeUintegerChecker<uint16_t> (0,100))
80 .AddAttribute (
"UlBandwidth",
81 "Set Dl Bandwidth for the first carrier component",
84 MakeUintegerChecker<uint16_t> (0,100))
168 return CreateSingleCc (ulBandwidth, dlBandwidth, ulEarfcn, dlEarfcn, isPrimary);
171 std::map< uint8_t, ComponentCarrier >
174 std::map< uint8_t, ComponentCarrier > ccmap;
201 ccmap.insert (std::pair<uint8_t, ComponentCarrier >(i, cc));
205 ", ulEarfcn: " << ulEarfcn <<
206 ", dlEarfcn: " << dlEarfcn);
210 uint32_t frequencyShift = 300 * (1 + (maxBandwidthKhz - 1) / 300);
213 uint32_t earfcnShift = frequencyShift / 100;
214 ulEarfcn += earfcnShift;
215 dlEarfcn += earfcnShift;
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
ComponentCarrier DoCreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary)
Create single CC.
void SetAsPrimary(bool primaryCarrier)
Set as primary carrier.
void SetUlBandwidth(uint16_t ulBandwidth)
Set UL bandwidth.
uint32_t GetDlEarfcn()
Get DL EARFCN.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Register this type.
void SetNumberOfComponentCarriers(uint16_t nCc)
Set number of CCs.
virtual void DoDispose(void)
Destructor implementation.
Hold a value for an Attribute.
uint16_t m_numberOfComponentCarriers
Number of component carriers.
std::map< uint8_t, ComponentCarrier > EquallySpacedCcs()
EquallySpacedCcs() create a valid std::map< uint8_t, Ptr<ComponentCarrier> > The Primary Component Ca...
uint16_t GetNumberOfComponentCarriers()
Get number of component carriers.
void SetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth.
uint32_t GetUlEarfcn() const
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetDlEarfcn(uint32_t earfcn)
virtual void SetUlBandwidth(uint16_t bw)
void SetUlEarfcn(uint32_t earfcn)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
ObjectFactory m_ccFactory
Factory for each Carrier Component.
uint32_t m_dlEarfcn
Downlink EARFCN.
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
virtual void DoInitialize(void)
Initialize() implementation.
A base class which provides memory management and object aggregation.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t GetDlEarfcn() const
static double GetChannelBandwidth(uint16_t txBandwidthConf)
static uint16_t GetDownlinkCarrierBand(uint32_t nDl)
Converts downlink EARFCN to corresponding LTE frequency band number.
uint16_t GetDlBandwidth()
Get DL bandwidth.
virtual void SetDlBandwidth(uint16_t bw)
uint16_t m_ulBandwidth
Uplink Bandwidth.
void SetUlEarfcn(uint32_t ulEarfcn)
Set UL EARFCN.
uint32_t m_ulEarfcn
Uplink EARFCN.
uint16_t GetUlBandwidth()
Get UL bandwidth.
static uint16_t GetUplinkCarrierBand(uint32_t nUl)
Converts uplink EARFCN to corresponding LTE frequency band number.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
uint32_t GetUlEarfcn()
Get UL EARFCN.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Hold an unsigned integer type.
static TypeId GetTypeId(void)
Get the type ID.
ComponentCarrier CreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary)
Create a single component carrier.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
virtual void DoDispose(void)
Destructor implementation.
uint16_t m_dlBandwidth
Downlink Bandwidth.
void SetDlEarfcn(uint32_t dlEarfcn)
Set DL EARFCN.
void SetCcAttribute(std::string n, const AttributeValue &v)
Set an attribute for the Component Carrier to be created.