5G-LENA nr-v3.0-32-g83aee33
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-control-messages.cc
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
7#include "nr-control-messages.h"
8
9#include <ns3/log.h>
10
11namespace ns3
12{
13
14NS_LOG_COMPONENT_DEFINE("nrControlMessage");
15
17{
18 NS_LOG_FUNCTION(this);
19}
20
22{
23 NS_LOG_FUNCTION(this);
24}
25
26void
28{
29 m_messageType = type;
30}
31
34{
35 return m_messageType;
36}
37
38void
40{
41 m_bwpId = bwpId;
42}
43
44uint16_t
46{
47 NS_ABORT_IF(m_bwpId < 0);
48 return static_cast<uint16_t>(m_bwpId);
49}
50
52{
53 NS_LOG_FUNCTION(this);
55}
56
58{
59 NS_LOG_FUNCTION(this);
60}
61
62void
64{
65 m_rnti = rnti;
66}
67
68uint16_t
70{
71 return m_rnti;
72}
73
74NrDlDciMessage::NrDlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci)
75 : m_dciInfoElement(dci)
76{
77 NS_LOG_FUNCTION(this);
79}
80
82{
83 NS_LOG_FUNCTION(this);
84}
85
86std::shared_ptr<DciInfoElementTdma>
88{
89 return m_dciInfoElement;
90}
91
92void
94{
95 m_k = delay;
96}
97
98void
100{
101 m_k1 = delay;
102}
103
104uint32_t
106{
107 return m_k;
108}
109
110uint32_t
112{
113 return m_k1;
114}
115
116NrUlDciMessage::NrUlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci)
117 : m_dciInfoElement(dci)
118{
119 NS_LOG_FUNCTION(this);
121}
122
124{
125 NS_LOG_FUNCTION(this);
126}
127
128std::shared_ptr<DciInfoElementTdma>
130{
131 return m_dciInfoElement;
132}
133
134void
136{
137 m_k = delay;
138}
139
140uint32_t
142{
143 return m_k;
144}
145
147{
148 NS_LOG_FUNCTION(this);
150}
151
153{
154 NS_LOG_FUNCTION(this);
155}
156
157void
159{
160 m_cqi = cqi;
161}
162
165{
166 return m_cqi;
167}
168
169// ----------------------------------------------------------------------------------------------------------
170
175
179
180void
182{
183 m_bsr = bsr;
184}
185
188{
189 return m_bsr;
190}
191
192// ----------------------------------------------------------------------------------------------------------
193
198
199void
200NrMibMessage::SetMib(LteRrcSap::MasterInformationBlock mib)
201{
202 m_mib = mib;
203}
204
205LteRrcSap::MasterInformationBlock
207{
208 return m_mib;
209}
210
211// ----------------------------------------------------------------------------------------------------------
212
217
218void
219NrSib1Message::SetSib1(LteRrcSap::SystemInformationBlockType1 sib1)
220{
221 m_sib1 = sib1;
222}
223
224LteRrcSap::SystemInformationBlockType1
226{
227 return m_sib1;
228}
229
230// ----------------------------------------------------------------------------------------------------------
231
236
240
241void
243{
244 m_rapId = rapId;
245}
246
247uint32_t
249{
250 return m_rapId;
251}
252
253// ----------------------------------------------------------------------------------------------------------
254
259
263
264void
266{
267 m_raRnti = raRnti;
268}
269
270uint16_t
272{
273 return m_raRnti;
274}
275
276void
278{
279 m_rarList.push_back(rar);
280}
281
282std::list<NrRarMessage::Rar>::const_iterator
284{
285 return m_rarList.begin();
286}
287
288std::list<NrRarMessage::Rar>::const_iterator
290{
291 return m_rarList.end();
292}
293
298
302
303void
308
311{
312 return m_dlHarqInfo;
313}
314
319
320std::ostream&
321operator<<(std::ostream& os, const LteNrTddSlotType& item)
322{
323 switch (item)
324 {
326 os << "DL";
327 break;
329 os << "F";
330 break;
332 os << "S";
333 break;
335 os << "UL";
336 break;
337 }
338 return os;
339}
340
341} // 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.
LteRrcSap::MasterInformationBlock GetMib() const
Retrieve the MIB content from this control message.
void SetMib(LteRrcSap::MasterInformationBlock mib)
Replace the MIB content of this control message.
NrMibMessage()
Create a new instance of MIB 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(LteRrcSap::SystemInformationBlockType1 sib1)
Replace the SIB1 content of this control message.
LteRrcSap::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.