12#include <ns3/component-carrier.h>
14#include <ns3/lte-spectrum-value-helper.h>
15#include <ns3/pointer.h>
16#include <ns3/string.h>
17#include <ns3/uinteger.h>
49 .AddConstructor<CcHelper>()
50 .AddAttribute(
"NumberOfComponentCarriers",
51 "Set the number of Component Carriers to setup per eNodeB"
52 "Currently the maximum Number of Component Carriers allowed is 2",
56 .AddAttribute(
"UlEarfcn",
57 "Set Ul Channel [EARFCN] for the first carrier component",
61 .AddAttribute(
"DlEarfcn",
62 "Set Dl Channel [EARFCN] for the first carrier component",
66 .AddAttribute(
"DlBandwidth",
67 "Set Dl Bandwidth for the first carrier component",
71 .AddAttribute(
"UlBandwidth",
72 "Set Dl Bandwidth for the first carrier component",
161 uint16_t dlBandwidth,
166 return CreateSingleCc(ulBandwidth, dlBandwidth, ulEarfcn, dlEarfcn, isPrimary);
169std::map<uint8_t, ComponentCarrier>
172 std::map<uint8_t, ComponentCarrier> ccmap;
200 ccmap.insert(std::pair<uint8_t, ComponentCarrier>(i, cc));
203 <<
", ulEarfcn: " << ulEarfcn <<
", dlEarfcn: " << dlEarfcn);
207 uint32_t frequencyShift = 300 * (1 + (maxBandwidthKhz - 1) / 300);
210 uint32_t earfcnShift = frequencyShift / 100;
211 ulEarfcn += earfcnShift;
212 dlEarfcn += earfcnShift;
220 uint16_t dlBandwidth,
223 bool isPrimary)
const
Hold a value for an Attribute.
uint32_t GetUlEarfcn() const
Get UL EARFCN.
ObjectFactory m_ccFactory
Factory for each Carrier Component.
void SetNumberOfComponentCarriers(uint16_t nCc)
Set number of CCs.
ComponentCarrier DoCreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary)
Create single CC.
void SetDlEarfcn(uint32_t dlEarfcn)
Set DL EARFCN.
void DoDispose() override
Destructor implementation.
uint16_t GetDlBandwidth() const
Get DL bandwidth.
uint32_t GetDlEarfcn() const
Get DL EARFCN.
void SetUlBandwidth(uint16_t ulBandwidth)
Set UL bandwidth.
void SetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth.
uint16_t m_numberOfComponentCarriers
Number of component carriers.
uint16_t GetUlBandwidth() const
Get UL bandwidth.
uint16_t m_ulBandwidth
Uplink Bandwidth.
uint16_t m_dlBandwidth
Downlink Bandwidth.
static TypeId GetTypeId()
Register this type.
std::map< uint8_t, ComponentCarrier > EquallySpacedCcs()
EquallySpacedCcs() create a valid std::map< uint8_t, Ptr<ComponentCarrier> > The Primary Component Ca...
void SetUlEarfcn(uint32_t ulEarfcn)
Set UL EARFCN.
uint16_t GetNumberOfComponentCarriers() const
Get number of component carriers.
void DoInitialize() override
Initialize() implementation.
uint32_t m_ulEarfcn
Uplink EARFCN.
uint32_t m_dlEarfcn
Downlink EARFCN.
void SetCcAttribute(std::string n, const AttributeValue &v)
Set an attribute for the Component Carrier to be created.
ComponentCarrier CreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary) const
Create a single component carrier.
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
void SetDlEarfcn(uint32_t earfcn)
uint32_t GetDlEarfcn() const
void SetUlEarfcn(uint32_t earfcn)
void SetAsPrimary(bool primaryCarrier)
Set as primary carrier.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetUlEarfcn() const
virtual void SetUlBandwidth(uint16_t bw)
virtual void SetDlBandwidth(uint16_t bw)
static uint16_t GetUplinkCarrierBand(uint32_t nUl)
Converts uplink EARFCN to corresponding LTE frequency band number.
static uint16_t GetDownlinkCarrierBand(uint32_t nDl)
Converts downlink EARFCN to corresponding LTE frequency band number.
static double GetChannelBandwidth(uint16_t txBandwidthConf)
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
virtual void DoDispose()
Destructor implementation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.