A Discrete-Event Network Simulator
API
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 
30 namespace ns3
31 {
32 
33 class LteEnbNetDevice;
34 
42 {
43  public:
47  virtual ~LteEnbCphySapProvider();
48 
54  virtual void SetCellId(uint16_t cellId) = 0;
55 
62  virtual void SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth) = 0;
63 
70  virtual void SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn) = 0;
71 
77  virtual void AddUe(uint16_t rnti) = 0;
78 
84  virtual void RemoveUe(uint16_t rnti) = 0;
85 
92  virtual void SetPa(uint16_t rnti, double pa) = 0;
93 
100  virtual void SetTransmissionMode(uint16_t rnti, uint8_t txMode) = 0;
101 
108  virtual void SetSrsConfigurationIndex(uint16_t rnti, uint16_t srsCi) = 0;
109 
116 
123 
129  virtual int8_t GetReferenceSignalPower() = 0;
130 };
131 
139 {
140  public:
144  virtual ~LteEnbCphySapUser();
145 };
146 
151 template <class C>
153 {
154  public:
160  MemberLteEnbCphySapProvider(C* owner);
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;
176  int8_t GetReferenceSignalPower() override;
177 
178  private:
179  C* m_owner;
180 };
181 
182 template <class C>
184  : m_owner(owner)
185 {
186 }
187 
188 template <class C>
189 void
191 {
192  m_owner->DoSetCellId(cellId);
193 }
194 
195 template <class C>
196 void
197 MemberLteEnbCphySapProvider<C>::SetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
198 {
199  m_owner->DoSetBandwidth(ulBandwidth, dlBandwidth);
200 }
201 
202 template <class C>
203 void
204 MemberLteEnbCphySapProvider<C>::SetEarfcn(uint32_t ulEarfcn, uint32_t dlEarfcn)
205 {
206  m_owner->DoSetEarfcn(ulEarfcn, dlEarfcn);
207 }
208 
209 template <class C>
210 void
212 {
213  m_owner->DoAddUe(rnti);
214 }
215 
216 template <class C>
217 void
219 {
220  m_owner->DoRemoveUe(rnti);
221 }
222 
223 template <class C>
224 void
225 MemberLteEnbCphySapProvider<C>::SetPa(uint16_t rnti, double pa)
226 {
227  m_owner->DoSetPa(rnti, pa);
228 }
229 
230 template <class C>
231 void
233 {
234  m_owner->DoSetTransmissionMode(rnti, txMode);
235 }
236 
237 template <class C>
238 void
240 {
241  m_owner->DoSetSrsConfigurationIndex(rnti, srsCi);
242 }
243 
244 template <class C>
245 void
247 {
248  m_owner->DoSetMasterInformationBlock(mib);
249 }
250 
251 template <class C>
252 void
255 {
256  m_owner->DoSetSystemInformationBlockType1(sib1);
257 }
258 
259 template <class C>
260 int8_t
262 {
263  return m_owner->DoGetReferenceSignalPower();
264 }
265 
270 template <class C>
272 {
273  public:
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;
288 };
289 
290 template <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