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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>,
18 * Marco Miozzo <mmiozzo@cttc.es>
19 */
20
21#ifndef LTE_ENB_CPHY_SAP_H
22#define LTE_ENB_CPHY_SAP_H
23
24#include "lte-rrc-sap.h"
25
26#include <ns3/ptr.h>
27
28#include <stdint.h>
29
30namespace ns3
31{
32
33class LteEnbNetDevice;
34
35/**
36 * Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes
37 *
38 * This is the PHY SAP Provider, i.e., the part of the SAP that contains
39 * the PHY methods called by the MAC
40 */
42{
43 public:
44 /**
45 * Destructor
46 */
47 virtual ~LteEnbCphySapProvider();
48
49 /**
50 * Set cell ID
51 *
52 * \param cellId the Cell Identifier
53 */
54 virtual void SetCellId(uint16_t cellId) = 0;
55
56 /**
57 * Set bandwidth
58 *
59 * \param ulBandwidth the UL bandwidth in PRBs
60 * \param dlBandwidth the DL bandwidth in PRBs
61 */
62 virtual void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth) = 0;
63
64 /**
65 * Set EARFCN
66 *
67 * \param ulEarfcn the UL EARFCN
68 * \param dlEarfcn the DL EARFCN
69 */
70 virtual void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn) = 0;
71
72 /**
73 * Add a new UE to the cell
74 *
75 * \param rnti the UE id relative to this cell
76 */
77 virtual void AddUe(uint16_t rnti) = 0;
78
79 /**
80 * Remove an UE from the cell
81 *
82 * \param rnti the UE id relative to this cell
83 */
84 virtual void RemoveUe(uint16_t rnti) = 0;
85
86 /**
87 * Set the UE transmission power offset P_A
88 *
89 * \param rnti the UE id relative to this cell
90 * \param pa transmission power offset
91 */
92 virtual void SetPa(uint16_t rnti, double pa) = 0;
93
94 /**
95 * Set transmission mode
96 *
97 * \param rnti the RNTI of the user
98 * \param txMode the transmissionMode of the user
99 */
100 virtual void SetTransmissionMode(uint16_t rnti, uint8_t txMode) = 0;
101
102 /**
103 * Set SRS configuration index
104 *
105 * \param rnti the RNTI of the user
106 * \param srsCi the SRS Configuration Index of the user
107 */
108 virtual void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi) = 0;
109
110 /**
111 * Set master information block
112 *
113 * \param mib the Master Information Block to be sent on the BCH
114 */
116
117 /**
118 * Set system information block type 1
119 *
120 * \param sib1 the System Information Block Type 1 to be sent on the BCH
121 */
123
124 /**
125 * Get reference signal power
126 *
127 * \return Reference Signal Power for SIB2
128 */
130};
131
132/**
133 * Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes
134 *
135 * This is the CPHY SAP User, i.e., the part of the SAP that contains the RRC
136 * methods called by the PHY
137 */
139{
140 public:
141 /**
142 * Destructor
143 */
144 virtual ~LteEnbCphySapUser();
145};
146
147/**
148 * Template for the implementation of the LteEnbCphySapProvider as a member
149 * of an owner class of type C to which all methods are forwarded
150 */
151template <class C>
153{
154 public:
155 /**
156 * Constructor
157 *
158 * \param owner the owner class
159 */
161
162 // Delete default constructor to avoid misuse
164
165 // inherited from LteEnbCphySapProvider
166 void SetCellId(uint16_t cellId) override;
167 void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth) override;
168 void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn) override;
169 void AddUe(uint16_t rnti) override;
170 void RemoveUe(uint16_t rnti) override;
171 void SetPa(uint16_t rnti, double pa) override;
172 void SetTransmissionMode(uint16_t rnti, uint8_t txMode) override;
173 void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi) override;
177
178 private:
179 C* m_owner; ///< the owner class
180};
181
182template <class C>
184 : m_owner(owner)
185{
186}
187
188template <class C>
189void
191{
192 m_owner->DoSetCellId(cellId);
193}
194
195template <class C>
196void
197MemberLteEnbCphySapProvider<C>::SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
198{
199 m_owner->DoSetBandwidth(ulBandwidth, dlBandwidth);
200}
201
202template <class C>
203void
205{
206 m_owner->DoSetEarfcn(ulEarfcn, dlEarfcn);
207}
208
209template <class C>
210void
212{
213 m_owner->DoAddUe(rnti);
214}
215
216template <class C>
217void
219{
220 m_owner->DoRemoveUe(rnti);
221}
222
223template <class C>
224void
226{
227 m_owner->DoSetPa(rnti, pa);
228}
229
230template <class C>
231void
233{
234 m_owner->DoSetTransmissionMode(rnti, txMode);
235}
236
237template <class C>
238void
240{
241 m_owner->DoSetSrsConfigurationIndex(rnti, srsCi);
242}
243
244template <class C>
245void
247{
248 m_owner->DoSetMasterInformationBlock(mib);
249}
250
251template <class C>
252void
255{
256 m_owner->DoSetSystemInformationBlockType1(sib1);
257}
258
259template <class C>
260int8_t
262{
263 return m_owner->DoGetReferenceSignalPower();
264}
265
266/**
267 * Template for the implementation of the LteEnbCphySapUser as a member
268 * of an owner class of type C to which all methods are forwarded
269 */
270template <class C>
272{
273 public:
274 /**
275 * Constructor
276 *
277 * \param owner the owner class
278 */
279 MemberLteEnbCphySapUser(C* owner);
280
281 // Delete default constructor to avoid misuse
283
284 // methods inherited from LteEnbCphySapUser go here
285
286 private:
287 C* m_owner; ///< the owner class
288};
289
290template <class C>
292 : m_owner(owner)
293{
294}
295
296} // namespace ns3
297
298#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.
Definition: lte-rrc-sap.h:622
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:629