5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-control-messages.cc
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#include "nr-control-messages.h"
6
7#include <ns3/log.h>
8
9namespace ns3
10{
11
12NS_LOG_COMPONENT_DEFINE("nrControlMessage");
13
15{
16 NS_LOG_FUNCTION(this);
17}
18
20{
21 NS_LOG_FUNCTION(this);
22}
23
24void
26{
27 m_messageType = type;
28}
29
32{
33 return m_messageType;
34}
35
36void
38{
39 m_bwpId = bwpId;
40}
41
42uint16_t
44{
45 NS_ABORT_IF(m_bwpId < 0);
46 return static_cast<uint16_t>(m_bwpId);
47}
48
50{
51 NS_LOG_FUNCTION(this);
53}
54
56{
57 NS_LOG_FUNCTION(this);
58}
59
60void
62{
63 m_rnti = rnti;
64}
65
66uint16_t
68{
69 return m_rnti;
70}
71
72NrDlDciMessage::NrDlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci)
73 : m_dciInfoElement(dci)
74{
75 NS_LOG_FUNCTION(this);
77}
78
80{
81 NS_LOG_FUNCTION(this);
82}
83
84std::shared_ptr<DciInfoElementTdma>
86{
87 return m_dciInfoElement;
88}
89
90void
92{
93 m_k = delay;
94}
95
96void
98{
99 m_k1 = delay;
100}
101
102uint32_t
104{
105 return m_k;
106}
107
108uint32_t
110{
111 return m_k1;
112}
113
114NrUlDciMessage::NrUlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci)
115 : m_dciInfoElement(dci)
116{
117 NS_LOG_FUNCTION(this);
119}
120
122{
123 NS_LOG_FUNCTION(this);
124}
125
126std::shared_ptr<DciInfoElementTdma>
128{
129 return m_dciInfoElement;
130}
131
132void
134{
135 m_k = delay;
136}
137
138uint32_t
140{
141 return m_k;
142}
143
145{
146 NS_LOG_FUNCTION(this);
148}
149
151{
152 NS_LOG_FUNCTION(this);
153}
154
155void
157{
158 m_cqi = cqi;
159}
160
163{
164 return m_cqi;
165}
166
167// ----------------------------------------------------------------------------------------------------------
168
173
177
178void
180{
181 m_bsr = bsr;
182}
183
186{
187 return m_bsr;
188}
189
190// ----------------------------------------------------------------------------------------------------------
191
196
197void
202
205{
206 return m_mib;
207}
208
209// ----------------------------------------------------------------------------------------------------------
210
215
216void
221
224{
225 return m_sib1;
226}
227
228// ----------------------------------------------------------------------------------------------------------
229
234
238
239void
241{
242 m_rapId = rapId;
243}
244
245uint32_t
247{
248 return m_rapId;
249}
250
251// ----------------------------------------------------------------------------------------------------------
252
257
261
262void
264{
265 m_raRnti = raRnti;
266}
267
268uint16_t
270{
271 return m_raRnti;
272}
273
274void
276{
277 m_rarList.push_back(rar);
278}
279
280std::list<NrRarMessage::Rar>::const_iterator
282{
283 return m_rarList.begin();
284}
285
286std::list<NrRarMessage::Rar>::const_iterator
288{
289 return m_rarList.end();
290}
291
296
300
301void
306
309{
310 return m_dlHarqInfo;
311}
312
317
318std::ostream&
319operator<<(std::ostream& os, const LteNrTddSlotType& item)
320{
321 switch (item)
322 {
324 os << "DL";
325 break;
327 os << "F";
328 break;
330 os << "S";
331 break;
333 os << "UL";
334 break;
335 }
336 return os;
337}
338
339} // namespace ns3
NrBsrMessage()
NrBsrMessage constructor.
MacCeElement GetBsr()
Get BSR information.
void SetBsr(MacCeElement bsr)
add a BSR feedback record into the message.
~NrBsrMessage() override
~NrBsrMessage
virtual ~NrControlMessage()
~NrControlMessage
void SetSourceBwp(uint16_t bwpId)
Set the BWP in which this message has been generated.
messageType GetMessageType() const
Get the MessageType.
uint16_t GetSourceBwp() const
NrControlMessage()
NrControlMessage.
void SetMessageType(messageType type)
Set the MessageType.
messageType
The Message Type.
@ UL_DCI
The resources allocation map from the BS to the attached UEs (UL)
@ DL_HARQ
DL HARQ feedback.
@ RACH_PREAMBLE
Random Access Preamble.
@ MIB
Master Information Block.
@ SR
Scheduling Request: asking for space.
@ BSR
Buffer Status Report.
@ RAR
Random Access Response.
@ SIB1
System Information Block Type 1.
@ DL_DCI
The resources allocation map from the BS to the attached UEs (DL)
DlCqiInfo GetDlCqi()
Get the DlCqi in this message.
void SetDlCqi(DlCqiInfo cqi)
Set the DlCqi to transmit.
~NrDlCqiMessage() override
~NrDlCqiMessage
NrDlCqiMessage()
NrDlCqiMessage constructor.
std::shared_ptr< DciInfoElementTdma > GetDciInfoElement()
Get the DCI.
void SetK1Delay(uint32_t delay)
Set the delay (in slots) between DL Data reception and subframe to which it applies for Harq feedback...
~NrDlDciMessage() override
~NrDlDciMessage
uint32_t GetKDelay() const
Get the delay (in slots) between DCI reception and subframe to which it applies for reception/transmi...
NrDlDciMessage(const std::shared_ptr< DciInfoElementTdma > &dci)
NrDlDciMessage constructor.
uint32_t GetK1Delay() const
Get the delay (in slots) between DL Data reception and subframe to which it applies for Harq feedback...
void SetKDelay(uint32_t delay)
Set the delay (in slots) between DL DCI reception and subframe to which it applies for reception/tran...
void SetDlHarqFeedback(DlHarqInfo m)
add a DL HARQ feedback record into the message.
~NrDlHarqFeedbackMessage() override
~NrDlHarqFeedbackMessage
NrDlHarqFeedbackMessage()
NrDlHarqFeedbackMessage constructor.
DlHarqInfo GetDlHarqFeedback()
Get DL HARQ information.
NrMibMessage()
Create a new instance of MIB control message.
NrRrcSap::MasterInformationBlock GetMib() const
Retrieve the MIB content from this control message.
void SetMib(NrRrcSap::MasterInformationBlock mib)
Replace the MIB content of this control message.
NrRachPreambleMessage()
NrRachPreambleMessage constructor.
~NrRachPreambleMessage() override
~NrRachPreambleMessage
std::list< Rar >::const_iterator RarListBegin() const
void SetRaRnti(uint16_t raRnti)
std::list< Rar >::const_iterator RarListEnd() const
NrRarMessage()
NrRarMessage constructor.
~NrRarMessage() override
~NrRarMessage
uint16_t GetRaRnti() const
NrSRMessage()
NrSRMessage constructor.
~NrSRMessage() override
~NrSRMessage
uint16_t GetRNTI() const
Get the RNTI of this message.
void SetRNTI(uint16_t rnti)
Set the RNTI to which this message is intended.
NrSib1Message()
Create a new instance of SIB1 control message.
void SetSib1(NrRrcSap::SystemInformationBlockType1 sib1)
Replace the SIB1 content of this control message.
NrRrcSap::SystemInformationBlockType1 GetSib1() const
Retrieve the SIB1 content from this control message.
NrSrsMessage()
NrDlHarqFeedbackMessage constructor.
NrUlDciMessage(const std::shared_ptr< DciInfoElementTdma > &dci)
NrUlDciMessage constructor.
uint32_t GetKDelay() const
Get the delay (in slots) between UCI reception and subframe to which it applies for reception/transmi...
void SetKDelay(uint32_t delay)
Set the delay (in slots) between UCI reception and subframe to which it applies for reception/transmi...
~NrUlDciMessage() override
~NrUlDciMessage
std::shared_ptr< DciInfoElementTdma > GetDciInfoElement()
Get the DCI.
LteNrTddSlotType
Available TDD slot types. Ordering is important.
@ F
DL CTRL + DL DATA + UL DATA + UL CTRL.
@ S
DL CTRL + DL DATA + UL CTRL.
@ DL
DL CTRL + DL DATA.
@ UL
UL DATA + UL CTRL.
The DlCqiInfo struct.
A struct that contains info for the DL HARQ.
See section 4.3.14 macCEListElement.
MasterInformationBlock structure.
Definition nr-rrc-sap.h:627
SystemInformationBlockType1 structure.
Definition nr-rrc-sap.h:634