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;
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetAsPrimary(bool primaryCarrier)
Set as primary carrier.
void SetUlEarfcn(uint32_t ulEarfcn)
Set UL EARFCN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Hold a value for an Attribute.
static TypeId GetTypeId(void)
Register this type.
uint32_t GetUlEarfcn() const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void SetDlEarfcn(uint32_t dlEarfcn)
Set DL EARFCN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void DoDispose(void)
Destructor implementation.
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
void SetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth.
std::map< uint8_t, ComponentCarrier > EquallySpacedCcs()
EquallySpacedCcs() create a valid std::map< uint8_t, Ptr<ComponentCarrier> > The Primary Component Ca...
ComponentCarrier DoCreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary)
Create single CC.
ObjectFactory m_ccFactory
Factory for each Carrier Component.
uint32_t GetDlEarfcn()
Get DL EARFCN.
Hold an unsigned integer type.
void SetNumberOfComponentCarriers(uint16_t nCc)
Set number of CCs.
uint32_t m_dlEarfcn
Downlink EARFCN.
uint16_t GetNumberOfComponentCarriers()
Get number of component carriers.
uint16_t m_ulBandwidth
Uplink Bandwidth.
uint32_t GetUlEarfcn()
Get UL EARFCN.
void SetDlEarfcn(uint32_t earfcn)
void SetCcAttribute(std::string n, const AttributeValue &v)
Set an attribute for the Component Carrier to be created.
void SetUlEarfcn(uint32_t earfcn)
void SetUlBandwidth(uint16_t ulBandwidth)
Set UL bandwidth.
static uint16_t GetDownlinkCarrierBand(uint32_t nDl)
Converts downlink EARFCN to corresponding LTE frequency band number.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t m_dlBandwidth
Downlink Bandwidth.
static double GetChannelBandwidth(uint8_t txBandwidthConf)
uint16_t GetUlBandwidth()
Get UL bandwidth.
ComponentCarrier CreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary)
Create a single component carrier.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
virtual void DoDispose(void)
Destructor implementation.
void SetDlBandwidth(uint8_t bw)
uint16_t m_numberOfComponentCarriers
Number of component carriers.
void SetUlBandwidth(uint8_t bw)
static TypeId GetTypeId(void)
Get the type ID.
A base class which provides memory management and object aggregation.
virtual void DoInitialize(void)
Initialize() implementation.
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)
Set the parent TypeId.
uint32_t GetDlEarfcn() const
static uint16_t GetUplinkCarrierBand(uint32_t nUl)
Converts uplink EARFCN to corresponding LTE frequency band number.
uint32_t m_ulEarfcn
Uplink EARFCN.
uint16_t GetDlBandwidth()
Get DL bandwidth.