A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-component-carrier-manager.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
7 *
8 */
9
11
12#include "lte-common.h"
13
14#include <ns3/log.h>
15
16namespace ns3
17{
18
19NS_LOG_COMPONENT_DEFINE("LteUeComponentCarrierManager");
20NS_OBJECT_ENSURE_REGISTERED(LteUeComponentCarrierManager);
21
23 : m_ccmRrcSapUser(nullptr),
24 m_ccmRrcSapProvider(nullptr),
25 m_noOfComponentCarriers(0)
26{
27 NS_LOG_FUNCTION(this);
28}
29
34
37{
38 static TypeId tid =
39 TypeId("ns3::LteUeComponentCarrierManager").SetParent<Object>().SetGroupName("Lte");
40 return tid;
41}
42
43void
48
49void
55
62
63bool
66{
67 NS_LOG_FUNCTION(this);
68 bool result = false;
69 auto it = m_macSapProvidersMap.find(componentCarrierId);
70 if (componentCarrierId > m_noOfComponentCarriers)
71 {
72 NS_FATAL_ERROR("Inconsistent componentCarrierId or you didn't call "
73 "SetNumberOfComponentCarriers before calling this method");
74 }
75 if (it != m_macSapProvidersMap.end())
76 {
77 NS_FATAL_ERROR("Tried to allocated an existing componentCarrierId");
78 }
79 else
80 {
82 std::pair<uint8_t, LteMacSapProvider*>(componentCarrierId, sap));
83 result = true;
84 }
85 return result;
86}
87
88void
90{
91 NS_LOG_FUNCTION(this);
92 NS_ABORT_MSG_IF(noOfComponentCarriers < MIN_NO_CC || noOfComponentCarriers > MAX_NO_CC,
93 "Number of component carriers should be greater than 0 and less than 6");
94 m_noOfComponentCarriers = noOfComponentCarriers;
95 // Set the number of component carriers in UE RRC
96 m_ccmRrcSapUser->SetNumberOfComponentCarriers(noOfComponentCarriers);
97}
98
99} // end of namespace ns3
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:25
Service Access Point (SAP) offered by the UE component carrier manager to the UE RRC.
Service Access Point (SAP) offered by the UE RRC to the UE CCM.
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)=0
Set the number of component carriers.
LteUeCcmRrcSapProvider * m_ccmRrcSapProvider
Receive API calls from the UE RRC instance.
void SetNumberOfComponentCarriers(uint8_t noOfComponentCarriers)
Sets number of component carriers that are supported by this UE.
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
Map of pointers to SAP to interfaces of the MAC instance if the flows of this UE.
uint8_t m_noOfComponentCarriers
The number of component carriers that this UE can support.
virtual void SetLteCcmRrcSapUser(LteUeCcmRrcSapUser *s)
Set the "user" part of the ComponentCarrier Management SAP interface that this UE component carrier m...
LteUeCcmRrcSapUser * m_ccmRrcSapUser
Interface to the UE RRC instance.
void DoDispose() override
Destructor implementation.
virtual LteUeCcmRrcSapProvider * GetLteCcmRrcSapProvider()
Exports the "provider" part of the ComponentCarrier Management SAP interface.
bool SetComponentCarrierMacSapProviders(uint8_t componentCarrierId, LteMacSapProvider *sap)
Sets a pointer to SAP interface of MAC instance for the specified carrier.
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Definition lte-common.h:28