src/lte/model/lte-ue-cphy-sap.h
changeset 9406 7f0f9d8f8e20
parent 9346 00e674a0d567
child 9485 938edff6f281
equal deleted inserted replaced
9399:50e7ff3a0366 9406:7f0f9d8f8e20
    23 #define LTE_UE_CPHY_SAP_H
    23 #define LTE_UE_CPHY_SAP_H
    24 
    24 
    25 #include <stdint.h>
    25 #include <stdint.h>
    26 #include <ns3/ptr.h>
    26 #include <ns3/ptr.h>
    27 
    27 
       
    28 #include <ns3/lte-rrc-sap.h>
       
    29 
    28 namespace ns3 {
    30 namespace ns3 {
    29 
    31 
    30 
    32 
    31 class LteEnbNetDevice;
    33 class LteEnbNetDevice;
    32 
    34 
    46   virtual ~LteUeCphySapProvider ();
    48   virtual ~LteUeCphySapProvider ();
    47 
    49 
    48   /** 
    50   /** 
    49    * tell the PHY to synchronize with a given eNB for communication purposes
    51    * tell the PHY to synchronize with a given eNB for communication purposes
    50    * 
    52    * 
    51    * \param enbPhy a pointer to the PHY of the eNB (wild hack, might go away in later versions)
       
    52    * \param cellId the ID of the eNB
    53    * \param cellId the ID of the eNB
    53    */
    54    * \param dlEarfcn  the carrier frequency (EARFCN) in downlink
    54   virtual void SyncronizeWithEnb (Ptr<LteEnbNetDevice> enbDevice, uint16_t cellId) = 0;
    55    */
       
    56   virtual void SyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn) = 0;
    55   
    57   
    56   /**
    58   /**
    57    *
    59    * \param dlBandwidth the DL bandwidth in PRBs
    58    * \param dlEarfcn the carrier frequency (EARFCN) in downlink
    60    */
    59    * \param ulEarfcn the carrier frequency (EARFCN) in downlink
    61   virtual void SetDlBandwidth (uint8_t dlBandwidth) = 0;
    60    */
    62 
    61   virtual void SetEarfcn (uint16_t dlEarfcn, uint16_t ulEarfcn) = 0;
    63   /** 
    62 
    64    * Configure uplink (normally done after reception of SIB2)
    63   /**
    65    * 
       
    66    * \param ulEarfcn the carrier frequency (EARFCN) in uplink
    64    * \param ulBandwidth the UL bandwidth in PRBs
    67    * \param ulBandwidth the UL bandwidth in PRBs
    65    * \param dlBandwidth the DL bandwidth in PRBs
    68    */
    66    */
    69   virtual void ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth) = 0;
    67   virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth) = 0;
    70 
    68   
       
    69   /** 
    71   /** 
    70    * 
    72    * 
    71    * \param rnti the cell-specific UE identifier
    73    * \param rnti the cell-specific UE identifier
    72    */
    74    */
    73   virtual void SetRnti (uint16_t rnti) = 0;
    75   virtual void SetRnti (uint16_t rnti) = 0;
    97   
    99   
    98   /** 
   100   /** 
    99    * destructor
   101    * destructor
   100    */
   102    */
   101   virtual ~LteUeCphySapUser ();
   103   virtual ~LteUeCphySapUser ();
       
   104 
       
   105 
       
   106   /** 
       
   107    * 
       
   108    * \param mib the Master Information Block received on the BCH
       
   109    */
       
   110   virtual void RecvMasterInformationBlock (LteRrcSap::MasterInformationBlock mib) = 0;
   102 };
   111 };
   103 
   112 
   104 
   113 
   105 
   114 
   106 
   115 
   114 {
   123 {
   115 public:
   124 public:
   116   MemberLteUeCphySapProvider (C* owner);
   125   MemberLteUeCphySapProvider (C* owner);
   117 
   126 
   118   // inherited from LteUeCphySapProvider
   127   // inherited from LteUeCphySapProvider
   119   virtual void SyncronizeWithEnb (Ptr<LteEnbNetDevice> enbDevice, uint16_t cellId);
   128   virtual void SyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn);  
   120   virtual void SetEarfcn (uint16_t dlEarfcn, uint16_t ulEarfcn);
   129   virtual void SetDlBandwidth (uint8_t ulBandwidth);
   121   virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
   130   virtual void ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth);
   122   virtual void SetRnti (uint16_t rnti);
   131   virtual void SetRnti (uint16_t rnti);
   123   virtual void SetTransmissionMode (uint8_t txMode);
   132   virtual void SetTransmissionMode (uint8_t txMode);
   124   virtual void SetSrsConfigurationIndex (uint16_t srcCi);
   133   virtual void SetSrsConfigurationIndex (uint16_t srcCi);
   125 
   134 
   126 private:
   135 private:
   139 {
   148 {
   140 }
   149 }
   141 
   150 
   142 template <class C>
   151 template <class C>
   143 void 
   152 void 
   144 MemberLteUeCphySapProvider<C>::SyncronizeWithEnb (Ptr<LteEnbNetDevice> enbDevice, uint16_t cellId)
   153 MemberLteUeCphySapProvider<C>::SyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
   145 {
   154 {
   146   m_owner->DoSyncronizeWithEnb (enbDevice, cellId);
   155   m_owner->DoSyncronizeWithEnb (cellId, dlEarfcn);
   147 }
   156 }
   148 
   157 
   149 template <class C>
   158 template <class C>
   150 void 
   159 void 
   151 MemberLteUeCphySapProvider<C>::SetEarfcn (uint16_t dlEarfcn, uint16_t ulEarfcn)
   160 MemberLteUeCphySapProvider<C>::SetDlBandwidth (uint8_t dlBandwidth)
   152 {
   161 {
   153   m_owner->DoSetEarfcn (dlEarfcn, ulEarfcn);
   162   m_owner->DoSetDlBandwidth (dlBandwidth);
   154 }
   163 }
   155 
   164 
   156 template <class C>
   165 template <class C>
   157 void 
   166 void 
   158 MemberLteUeCphySapProvider<C>::SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
   167 MemberLteUeCphySapProvider<C>::ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth)
   159 {
   168 {
   160   m_owner->DoSetBandwidth (ulBandwidth, dlBandwidth);
   169   m_owner->DoConfigureUplink (ulEarfcn, ulBandwidth);
   161 }
   170 }
   162 
   171 
   163 template <class C>
   172 template <class C>
   164 void 
   173 void 
   165 MemberLteUeCphySapProvider<C>::SetRnti (uint16_t rnti)
   174 MemberLteUeCphySapProvider<C>::SetRnti (uint16_t rnti)
   193 {
   202 {
   194 public:
   203 public:
   195   MemberLteUeCphySapUser (C* owner);
   204   MemberLteUeCphySapUser (C* owner);
   196 
   205 
   197   // methods inherited from LteUeCphySapUser go here
   206   // methods inherited from LteUeCphySapUser go here
       
   207   virtual void RecvMasterInformationBlock (LteRrcSap::MasterInformationBlock mib);
   198 
   208 
   199 private:
   209 private:
   200   MemberLteUeCphySapUser ();
   210   MemberLteUeCphySapUser ();
   201   C* m_owner;
   211   C* m_owner;
   202 };
   212 };
   210 template <class C>
   220 template <class C>
   211 MemberLteUeCphySapUser<C>::MemberLteUeCphySapUser ()
   221 MemberLteUeCphySapUser<C>::MemberLteUeCphySapUser ()
   212 {
   222 {
   213 }
   223 }
   214 
   224 
       
   225 template <class C> 
       
   226 void 
       
   227 MemberLteUeCphySapUser<C>::RecvMasterInformationBlock (LteRrcSap::MasterInformationBlock mib)
       
   228 {
       
   229   m_owner->DoRecvMasterInformationBlock (mib);
       
   230 }
       
   231 
   215 
   232 
   216 
   233 
   217 
   234 
   218 } // namespace ns3
   235 } // namespace ns3
   219 
   236