Skip to content

Commit cd5cc5b

Browse files
committed
LteControlInfo: moved entirely into msg file
1 parent 51d75b5 commit cd5cc5b

7 files changed

Lines changed: 29 additions & 181 deletions

File tree

src/simu5g/common/LteControlInfo.cc

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/simu5g/common/LteControlInfo.h

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -12,102 +12,7 @@
1212
#ifndef _LTE_LTECONTROLINFO_H_
1313
#define _LTE_LTECONTROLINFO_H_
1414

15-
#include "simu5g/common/LteCommon.h"
1615
#include "simu5g/common/LteControlInfo_m.h"
17-
#include <vector>
18-
19-
namespace simu5g {
20-
21-
class UserTxParams;
22-
23-
/**
24-
* @class UserControlInfo
25-
* @brief ControlInfo used in the Lte model
26-
*
27-
* This is the LteControlInfo Resource Block Vector
28-
* and Remote Antennas Set
29-
*
30-
*/
31-
class UserControlInfo : public UserControlInfo_Base
32-
{
33-
protected:
34-
35-
const UserTxParams *userTxParams = nullptr;
36-
RbMap grantedBlocks;
37-
/** @brief The movement of the sending host.*/
38-
//Move senderMovement;
39-
/** @brief The playground position of the sending host.*/
40-
inet::Coord senderCoord;
41-
42-
public:
43-
44-
/**
45-
* Constructor: base initialization
46-
* @param name packet name
47-
* @param kind packet kind
48-
*/
49-
UserControlInfo();
50-
~UserControlInfo() override;
51-
52-
/*
53-
* Operator = : packet copy
54-
* @param other source packet
55-
* @return reference to this packet
56-
*/
57-
UserControlInfo& operator=(const UserControlInfo& other);
58-
59-
/**
60-
* Copy constructor: packet copy
61-
* @param other source packet
62-
*/
63-
UserControlInfo(const UserControlInfo& other) :
64-
UserControlInfo_Base()
65-
{
66-
operator=(other);
67-
}
68-
69-
/**
70-
* dup() : packet duplicate
71-
* @return pointer to duplicate packet
72-
*/
73-
UserControlInfo *dup() const override
74-
{
75-
return new UserControlInfo(*this);
76-
}
77-
78-
void setUserTxParams(const UserTxParams *arg);
79-
80-
const UserTxParams *getUserTxParams() const
81-
{
82-
return userTxParams;
83-
}
84-
85-
const unsigned int getBlocks(Remote antenna, Band b) const
86-
{
87-
return grantedBlocks.at(antenna).at(b);
88-
}
89-
90-
void setBlocks(Remote antenna, Band b, const unsigned int blocks)
91-
{
92-
grantedBlocks[antenna][b] = blocks;
93-
}
94-
95-
const RbMap& getGrantedBlocks() const
96-
{
97-
return grantedBlocks;
98-
}
99-
100-
void setGrantedBlocks(const RbMap& rbMap)
101-
{
102-
grantedBlocks = rbMap;
103-
}
104-
105-
// struct used to request a feedback computation by nodeB
106-
FeedbackRequest feedbackReq;
107-
void setCoord(const inet::Coord& coord);
108-
inet::Coord getCoord() const;
109-
};
110-
111-
} //namespace
11216

11317
#endif
18+

src/simu5g/common/LteControlInfo.msg

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111

1212
import inet.common.INETDefs;
1313
import inet.common.TagBase;
14+
import inet.common.geometry.Geometry; // for Coord
1415
import simu5g.common.LteCommon;
16+
import simu5g.stack.mac.amc.UserTxParams;
1517

1618
namespace simu5g;
1719

1820

21+
class RbMap
22+
{
23+
@existingClass;
24+
@opaque;
25+
}
26+
1927
//
2028
// Control info usage in Simu5G simulator
2129
//
@@ -100,8 +108,6 @@ class FlowControlInfo extends LteControlInfo {
100108
// txMode, Resource blocks used, RemoteSet
101109
//
102110
class UserControlInfo extends LteControlInfo {
103-
@customize(true);
104-
105111
bool isNr = false;
106112
double carrierFrequency = NaN; // carrier frequency
107113

@@ -125,13 +131,21 @@ class UserControlInfo extends LteControlInfo {
125131
double d2dTxPower = NaN; // D2D Transmission Power (used for feedback reporting of D2D links
126132
// blocks granted on all Remotes, all Bands
127133
unsigned int totalGrantedBlocks = 0;
128-
129134
unsigned int grantId = 0; // grantId related to the grand that allowed the sending of a MEC PDU (used only for MAC PDU sent by UEs)
130135

131-
//#
132-
//# Follows a list of elements only present in
133-
//# the customized class (see LteControlInfo.h):
134-
//#
135-
//# RemoteSet ru; // Remote Antenna Set
136-
//# RbMap grantedBlocks; // Blocks allocated per Remote, per Band.
136+
UserTxParams *userTxParams @owned;
137+
RbMap grantedBlocks;
138+
inet::Coord coord; // The playground position of the sending host
139+
FeedbackRequest feedbackReq;
137140
}
141+
142+
cplusplus (UserControlInfo) {{
143+
virtual const unsigned int getBlocks(Remote antenna, Band b) const { return grantedBlocks.at(antenna).at(b); }
144+
virtual void setBlocks(Remote antenna, Band b, const unsigned int blocks) { grantedBlocks[antenna][b] = blocks; }
145+
}}
146+
147+
cplusplus (UserControlInfo::setUserTxParams) {{
148+
// Code inserted at top of setUserTxParams(); allows silent overwrite of earlier object.
149+
delete this->userTxParams;
150+
this->userTxParams = nullptr;
151+
}}

src/simu5g/stack/phy/LtePhyEnb.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void LtePhyEnb::requestFeedback(UserControlInfo *lteinfo, LteAirFrame *frame, Pa
256256
else
257257
throw cRuntimeError("LtePhyEnbD2D::requestFeedback - channelModel is a null pointer. Abort");
258258

259-
FeedbackRequest req = lteinfo->feedbackReq;
259+
FeedbackRequest req = lteinfo->getFeedbackReq();
260260
//Feedback computation
261261
fb.clear();
262262
//get number of RU
@@ -331,7 +331,7 @@ void LtePhyEnb::handleFeedbackPkt(UserControlInfo *lteinfo,
331331
*(pktAux->addTagIfAbsent<UserControlInfo>()) = *lteinfo;
332332

333333
// if feedback was generated by dummy phy we can send up to mac else nodeb should generate the "real" feedback
334-
if (lteinfo->feedbackReq.request) {
334+
if (lteinfo->getFeedbackReq().request) {
335335
requestFeedback(lteinfo, frame, pktAux);
336336

337337
// DEBUG

src/simu5g/stack/phy/LtePhyEnbD2D.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void LtePhyEnbD2D::requestFeedback(UserControlInfo *lteinfo, LteAirFrame *frame,
5151
snr = channelModel->getSINR(frame, lteinfo);
5252
else
5353
throw cRuntimeError("LtePhyEnbD2D::requestFeedback - channelModel is null pointer. Abort");
54-
FeedbackRequest req = lteinfo->feedbackReq;
54+
FeedbackRequest req = lteinfo->getFeedbackReq();
5555
// Feedback computation
5656
fb.clear();
5757
// Get number of RU

src/simu5g/stack/phy/LtePhyUe.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ void LtePhyUe::sendFeedback(LteFeedbackDoubleVector fbDl, LteFeedbackDoubleVecto
692692
// create LteAirFrame and encapsulate a feedback packet
693693
LteAirFrame *frame = new LteAirFrame("feedback_pkt");
694694
frame->encapsulate(check_and_cast<cPacket *>(pkt));
695-
uinfo->feedbackReq = req;
695+
uinfo->setFeedbackReq(req);
696696
uinfo->setDirection(UL);
697697
simtime_t signalLength = TTI;
698698
uinfo->setTxPower(txPower_);

src/simu5g/stack/phy/LtePhyUeD2D.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ void LtePhyUeD2D::sendFeedback(LteFeedbackDoubleVector fbDl, LteFeedbackDoubleVe
527527
// Create LteAirFrame and encapsulate a feedback packet
528528
LteAirFrame *frame = new LteAirFrame("feedback_pkt");
529529
frame->encapsulate(check_and_cast<cPacket *>(pkt));
530-
uinfo->feedbackReq = req;
530+
uinfo->setFeedbackReq(req);
531531
uinfo->setDirection(UL);
532532
simtime_t signalLength = TTI;
533533
uinfo->setTxPower(txPower_);

0 commit comments

Comments
 (0)