A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-ue-rrc.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef LTE_UE_RRC_H
22 #define LTE_UE_RRC_H
23 
24 #include <ns3/object.h>
25 #include <ns3/packet.h>
26 #include <ns3/lte-ue-cmac-sap.h>
27 #include <ns3/lte-pdcp-sap.h>
28 #include <ns3/lte-as-sap.h>
29 #include <ns3/lte-ue-cphy-sap.h>
30 #include <ns3/lte-rrc-sap.h>
31 #include <ns3/traced-callback.h>
32 
33 #include <map>
34 
35 namespace ns3 {
36 
37 class LteRlc;
38 class LteMacSapProvider;
39 class LteUeCmacSapUser;
40 class LteUeCmacSapProvider;
41 class LteDataRadioBearerInfo;
42 class LteSignalingRadioBearerInfo;
43 class LteEnbRrc;
44 
49 class LteUeRrc : public Object
50 {
51 
58 
59 public:
60 
65  enum State
66  {
76  };
77 
78 
83  LteUeRrc ();
84 
85 
89  virtual ~LteUeRrc ();
90 
91 
92  // inherited from Object
93 private:
94  virtual void DoInitialize (void);
95  virtual void DoDispose (void);
96 public:
97  static TypeId GetTypeId (void);
98 
99 
106 
113 
120 
127 
128 
135 
142 
151 
157  void SetAsSapUser (LteAsSapUser* s);
158 
165 
170  void SetImsi (uint64_t imsi);
171 
176  uint64_t GetImsi (void);
177 
178 
183  uint16_t GetRnti () const;
184 
185 
190  uint16_t GetCellId () const;
191 
192 
196  uint8_t GetUlBandwidth () const;
197 
201  uint8_t GetDlBandwidth () const;
202 
206  uint16_t GetDlEarfcn () const;
207 
211  uint16_t GetUlEarfcn () const;
212 
217  State GetState ();
218 
224  void SetUseRlcSm (bool val);
225 
226 
227 private:
228 
229 
230  // PDCP SAP methods
232 
233  // CMAC SAP methods
234  void DoSetTemporaryCellRnti (uint16_t rnti);
237 
238  // LTE AS SAP methods
239  void DoForceCampedOnEnb (uint16_t cellId, uint16_t earfcn);
240  void DoConnect ();
241  void DoSendData (Ptr<Packet> packet, uint8_t bid);
242  void DoDisconnect ();
243 
244  // CPHY SAP methods
246 
247  // RRC SAP methods
257 
258 
259  // internal methods
261  void StartConnection ();
262  void LeaveConnectedMode ();
263  void DisposeOldSrb1 ();
264  uint8_t Bid2Drbid (uint8_t bid);
265  void SwitchToState (State s);
266 
267  std::map<uint8_t, uint8_t> m_bid2DrbidMap;
268 
271 
274 
277 
280 
283 
285 
286  uint64_t m_imsi;
287  uint16_t m_rnti;
288  uint16_t m_cellId;
289 
293  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
294 
296 
298 
299  uint8_t m_dlBandwidth;
300  uint8_t m_ulBandwidth;
302  uint16_t m_dlEarfcn;
303  uint16_t m_ulEarfcn;
305  // imsi cellid rnti
307  // imsi cellid rnti
309  // imsi cellid rnti
311  // imsi cellid rnti
313  // imsi cellid rnti targetCellId
315  // imsi cellid rnti
317 
322 };
323 
324 
325 } // namespace ns3
326 
327 #endif // LTE_UE_RRC_H