22 #include <ns3/abort.h>
23 #include <ns3/component-carrier.h>
25 #include <ns3/lte-spectrum-value-helper.h>
26 #include <ns3/pointer.h>
27 #include <ns3/string.h>
28 #include <ns3/uinteger.h>
60 .AddConstructor<CcHelper>()
61 .AddAttribute(
"NumberOfComponentCarriers",
62 "Set the number of Component Carriers to setup per eNodeB"
63 "Currently the maximum Number of Component Carriers allowed is 2",
67 .AddAttribute(
"UlEarfcn",
68 "Set Ul Channel [EARFCN] for the first carrier component",
71 MakeUintegerChecker<uint32_t>())
72 .AddAttribute(
"DlEarfcn",
73 "Set Dl Channel [EARFCN] for the first carrier component",
76 MakeUintegerChecker<uint32_t>(0))
77 .AddAttribute(
"DlBandwidth",
78 "Set Dl Bandwidth for the first carrier component",
81 MakeUintegerChecker<uint16_t>(0, 100))
82 .AddAttribute(
"UlBandwidth",
83 "Set Dl Bandwidth for the first carrier component",
86 MakeUintegerChecker<uint16_t>(0, 100));
172 uint16_t dlBandwidth,
177 return CreateSingleCc(ulBandwidth, dlBandwidth, ulEarfcn, dlEarfcn, isPrimary);
180 std::map<uint8_t, ComponentCarrier>
183 std::map<uint8_t, ComponentCarrier> ccmap;
211 ccmap.insert(std::pair<uint8_t, ComponentCarrier>(i, cc));
214 <<
", ulEarfcn: " << ulEarfcn <<
", dlEarfcn: " << dlEarfcn);
218 uint32_t frequencyShift = 300 * (1 + (maxBandwidthKhz - 1) / 300);
221 uint32_t earfcnShift = frequencyShift / 100;
222 ulEarfcn += earfcnShift;
223 dlEarfcn += earfcnShift;
231 uint16_t dlBandwidth,
234 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.
#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.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)