A Discrete-Event Network Simulator
API
lte-ccm-mac-sap.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Danilo Abrignani
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: Danilo Abrignani <danilo.abrignani@unibo.it>
19  *
20  */
21 
22 #ifndef LTE_CCM_MAC_SAP_H
23 #define LTE_CCM_MAC_SAP_H
24 
25 #include <ns3/lte-rrc-sap.h>
26 #include <ns3/eps-bearer.h>
27 #include <ns3/lte-enb-cmac-sap.h>
28 #include <ns3/lte-mac-sap.h>
29 #include <ns3/ff-mac-common.h>
30 
31 
32 namespace ns3 {
44 {
45 
46 public:
47  virtual ~LteCcmMacSapProvider ();
48 
54  virtual void ReportMacCeToScheduler (MacCeListElement_s bsr) = 0;
55 
56 }; // end of class LteCcmMacSapProvider
57 
58 
71 {
72 public:
73  virtual ~LteCcmMacSapUser ();
80  virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId) = 0;
81 
87  virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId) = 0;
88 
89 }; // end of class LteCcmMacSapUser
90 
92 template <class C>
94 {
95 public:
101  MemberLteCcmMacSapProvider (C* owner);
102  // inherited from LteCcmRrcSapProvider
103  virtual void ReportMacCeToScheduler (MacCeListElement_s bsr);
104 
105 private:
106  C* m_owner;
107 };
108 
109 template <class C>
111  : m_owner (owner)
112 {
113 }
114 
115 template <class C>
117 {
118  m_owner->DoReportMacCeToScheduler (bsr);
119 }
120 
121 
123 template <class C>
125 {
126 public:
132  MemberLteCcmMacSapUser (C* owner);
133  // inherited from LteCcmRrcSapUser
134  virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId);
135  virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId);
136  // inherited from LteMacSapUser
137  virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
138  virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
139  virtual void NotifyHarqDeliveryFailure ();
140 
141 
142 private:
143  C* m_owner;
144 };
145 
146 template <class C>
148  : m_owner (owner)
149 {
150 }
151 
152 template <class C>
153 void MemberLteCcmMacSapUser<C>::UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId)
154 {
155  m_owner->DoUlReceiveMacCe (bsr, componentCarrierId);
156 }
157 
158 template <class C>
159 void MemberLteCcmMacSapUser<C>::NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId)
160 {
161  m_owner->DoNotifyPrbOccupancy (prbOccupancy, componentCarrierId);
162 }
163 
164 template <class C>
165 void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
166 {
167  m_owner->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
168 }
169 
170 template <class C>
171 void MemberLteCcmMacSapUser<C>::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
172 {
173  m_owner->DoReceivePdu (p, rnti, lcid);
174 }
175 
176 template <class C>
178 {
179  m_owner->DoNotifyHarqDeliveryFailure ();
180 }
181 
182 
183 } // end of namespace ns3
184 
185 
186 #endif /* LTE_CCM_MAC_SAP_H */
187 
Service Access Point (SAP) offered by the component carrier manager (CCM) by MAC to CCM...
virtual void NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId)
Notifies component carrier manager about physical resource block occupancy.
virtual void ReportMacCeToScheduler(MacCeListElement_s bsr)
Add the Buffer Status Report to the list.
virtual void NotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
Called by the MAC to notify the RLC that the scheduler granted a transmission opportunity to this RLC...
virtual void UlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)=0
When the Primary Component carrier receive a buffer status report it is sent to the CCM...
virtual void NotifyHarqDeliveryFailure()
Called by the MAC to notify the RLC that an HARQ process related to this RLC instance has failed...
MemberLteCcmMacSapProvider class.
See section 4.3.14 macCEListElement.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Service Access Point (SAP) offered by MAC to the component carrier manager (CCM). ...
virtual void ReceivePdu(Ptr< Packet > p, uint16_t rnti, uint8_t lcid)
Called by the MAC to notify the RLC of the reception of a new PDU.
MemberLteCcmMacSapUser(C *owner)
Constructor.
virtual void NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId)=0
Notifies component carrier manager about physical resource block occupancy.
virtual void ReportMacCeToScheduler(MacCeListElement_s bsr)=0
Add the Buffer Status Report to the list.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:95
MemberLteCcmMacSapUser class.
MemberLteCcmMacSapProvider(C *owner)
Constructor.
virtual void UlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)
When the Primary Component carrier receive a buffer status report it is sent to the CCM...
C * m_owner
the owner class