A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-enb-cphy-sap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>,
7 * Marco Miozzo <mmiozzo@cttc.es>
8 */
9
10#ifndef LTE_ENB_CPHY_SAP_H
11#define LTE_ENB_CPHY_SAP_H
12
13#include "lte-rrc-sap.h"
14
15#include <ns3/ptr.h>
16
17#include <stdint.h>
18
19namespace ns3
20{
21
22class LteEnbNetDevice;
23
24/**
25 * Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes
26 *
27 * This is the PHY SAP Provider, i.e., the part of the SAP that contains
28 * the PHY methods called by the MAC
29 */
31{
32 public:
33 /**
34 * Destructor
35 */
36 virtual ~LteEnbCphySapProvider();
37
38 /**
39 * Set cell ID
40 *
41 * \param cellId the Cell Identifier
42 */
43 virtual void SetCellId(uint16_t cellId) = 0;
44
45 /**
46 * Set bandwidth
47 *
48 * \param ulBandwidth the UL bandwidth in PRBs
49 * \param dlBandwidth the DL bandwidth in PRBs
50 */
51 virtual void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth) = 0;
52
53 /**
54 * Set EARFCN
55 *
56 * \param ulEarfcn the UL EARFCN
57 * \param dlEarfcn the DL EARFCN
58 */
59 virtual void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn) = 0;
60
61 /**
62 * Add a new UE to the cell
63 *
64 * \param rnti the UE id relative to this cell
65 */
66 virtual void AddUe(uint16_t rnti) = 0;
67
68 /**
69 * Remove an UE from the cell
70 *
71 * \param rnti the UE id relative to this cell
72 */
73 virtual void RemoveUe(uint16_t rnti) = 0;
74
75 /**
76 * Set the UE transmission power offset P_A
77 *
78 * \param rnti the UE id relative to this cell
79 * \param pa transmission power offset
80 */
81 virtual void SetPa(uint16_t rnti, double pa) = 0;
82
83 /**
84 * Set transmission mode
85 *
86 * \param rnti the RNTI of the user
87 * \param txMode the transmissionMode of the user
88 */
89 virtual void SetTransmissionMode(uint16_t rnti, uint8_t txMode) = 0;
90
91 /**
92 * Set SRS configuration index
93 *
94 * \param rnti the RNTI of the user
95 * \param srsCi the SRS Configuration Index of the user
96 */
97 virtual void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi) = 0;
98
99 /**
100 * Set master information block
101 *
102 * \param mib the Master Information Block to be sent on the BCH
103 */
105
106 /**
107 * Set system information block type 1
108 *
109 * \param sib1 the System Information Block Type 1 to be sent on the BCH
110 */
112
113 /**
114 * Get reference signal power
115 *
116 * \return Reference Signal Power for SIB2
117 */
119};
120
121/**
122 * Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes
123 *
124 * This is the CPHY SAP User, i.e., the part of the SAP that contains the RRC
125 * methods called by the PHY
126 */
128{
129 public:
130 /**
131 * Destructor
132 */
133 virtual ~LteEnbCphySapUser();
134};
135
136/**
137 * Template for the implementation of the LteEnbCphySapProvider as a member
138 * of an owner class of type C to which all methods are forwarded
139 */
140template <class C>
142{
143 public:
144 /**
145 * Constructor
146 *
147 * \param owner the owner class
148 */
150
151 // Delete default constructor to avoid misuse
153
154 // inherited from LteEnbCphySapProvider
155 void SetCellId(uint16_t cellId) override;
156 void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth) override;
157 void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn) override;
158 void AddUe(uint16_t rnti) override;
159 void RemoveUe(uint16_t rnti) override;
160 void SetPa(uint16_t rnti, double pa) override;
161 void SetTransmissionMode(uint16_t rnti, uint8_t txMode) override;
162 void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi) override;
166
167 private:
168 C* m_owner; ///< the owner class
169};
170
171template <class C>
173 : m_owner(owner)
174{
175}
176
177template <class C>
178void
180{
181 m_owner->DoSetCellId(cellId);
182}
183
184template <class C>
185void
186MemberLteEnbCphySapProvider<C>::SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
187{
188 m_owner->DoSetBandwidth(ulBandwidth, dlBandwidth);
189}
190
191template <class C>
192void
194{
195 m_owner->DoSetEarfcn(ulEarfcn, dlEarfcn);
196}
197
198template <class C>
199void
201{
202 m_owner->DoAddUe(rnti);
203}
204
205template <class C>
206void
208{
209 m_owner->DoRemoveUe(rnti);
210}
211
212template <class C>
213void
215{
216 m_owner->DoSetPa(rnti, pa);
217}
218
219template <class C>
220void
222{
223 m_owner->DoSetTransmissionMode(rnti, txMode);
224}
225
226template <class C>
227void
229{
230 m_owner->DoSetSrsConfigurationIndex(rnti, srsCi);
231}
232
233template <class C>
234void
236{
237 m_owner->DoSetMasterInformationBlock(mib);
238}
239
240template <class C>
241void
244{
245 m_owner->DoSetSystemInformationBlockType1(sib1);
246}
247
248template <class C>
249int8_t
251{
252 return m_owner->DoGetReferenceSignalPower();
253}
254
255/**
256 * Template for the implementation of the LteEnbCphySapUser as a member
257 * of an owner class of type C to which all methods are forwarded
258 */
259template <class C>
261{
262 public:
263 /**
264 * Constructor
265 *
266 * \param owner the owner class
267 */
268 MemberLteEnbCphySapUser(C* owner);
269
270 // Delete default constructor to avoid misuse
272
273 // methods inherited from LteEnbCphySapUser go here
274
275 private:
276 C* m_owner; ///< the owner class
277};
278
279template <class C>
281 : m_owner(owner)
282{
283}
284
285} // namespace ns3
286
287#endif // LTE_ENB_CPHY_SAP_H
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual ~LteEnbCphySapProvider()
Destructor.
virtual void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi)=0
Set SRS configuration index.
virtual void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)=0
Set bandwidth.
virtual void SetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1)=0
Set system information block type 1.
virtual void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn)=0
Set EARFCN.
virtual void SetTransmissionMode(uint16_t rnti, uint8_t txMode)=0
Set transmission mode.
virtual void RemoveUe(uint16_t rnti)=0
Remove an UE from the cell.
virtual void SetPa(uint16_t rnti, double pa)=0
Set the UE transmission power offset P_A.
virtual void SetCellId(uint16_t cellId)=0
Set cell ID.
virtual int8_t GetReferenceSignalPower()=0
Get reference signal power.
virtual void SetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib)=0
Set master information block.
virtual void AddUe(uint16_t rnti)=0
Add a new UE to the cell.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual ~LteEnbCphySapUser()
Destructor.
Template for the implementation of the LteEnbCphySapProvider as a member of an owner class of type C ...
void RemoveUe(uint16_t rnti) override
Remove an UE from the cell.
void SetCellId(uint16_t cellId) override
Set cell ID.
void SetPa(uint16_t rnti, double pa) override
Set the UE transmission power offset P_A.
void SetTransmissionMode(uint16_t rnti, uint8_t txMode) override
Set transmission mode.
void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi) override
Set SRS configuration index.
void AddUe(uint16_t rnti) override
Add a new UE to the cell.
void SetSystemInformationBlockType1(LteRrcSap::SystemInformationBlockType1 sib1) override
Set system information block type 1.
void SetMasterInformationBlock(LteRrcSap::MasterInformationBlock mib) override
Set master information block.
void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth) override
Set bandwidth.
int8_t GetReferenceSignalPower() override
Get reference signal power.
void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn) override
Set EARFCN.
Template for the implementation of the LteEnbCphySapUser as a member of an owner class of type C to w...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MasterInformationBlock structure.
SystemInformationBlockType1 structure.