Skip to content

Commit a81f613

Browse files
committed
Pdcp: removed getDirection(), it trivially follows from node type
Redundant calls also removed, direction already set from setTrafficInformation()
1 parent d00220f commit a81f613

5 files changed

Lines changed: 3 additions & 17 deletions

File tree

src/simu5g/stack/pdcp/LtePdcp.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ void LtePdcpBase::setTrafficInformation(cPacket *pkt, inet::Ptr<FlowControlInfo>
6161
lteInfo->setRlcType(backgroundRlc_);
6262
}
6363

64-
lteInfo->setDirection(getDirection());
64+
// direction of transmitted packets depends on node type
65+
Direction dir = getNodeTypeById(nodeId_) == UE ? UL : DL;
66+
lteInfo->setDirection(dir);
6567
}
6668

6769
LogicalCid LtePdcpBase::lookupOrAssignLcid(const ConnectionKey& key)

src/simu5g/stack/pdcp/LtePdcp.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ class LtePdcpBase : public cSimpleModule
256256
*
257257
* @return Direction of traffic
258258
*/
259-
virtual Direction getDirection() = 0;
260259
void setTrafficInformation(cPacket *pkt, inet::Ptr<FlowControlInfo> lteInfo);
261260

262261
/*
@@ -334,12 +333,6 @@ class LtePdcpUe : public LtePdcpBase
334333
return binder_->getNextHop(nodeId_);
335334
}
336335

337-
Direction getDirection() override
338-
{
339-
// Data coming from DataPort on UE are always Uplink
340-
return UL;
341-
}
342-
343336
public:
344337
void initialize(int stage) override;
345338
void deleteEntities(MacNodeId nodeId) override;
@@ -373,12 +366,6 @@ class LtePdcpEnb : public LtePdcpBase
373366
return destId;
374367
}
375368

376-
Direction getDirection() override
377-
{
378-
// Data coming from DataPort on ENB are always Downlink
379-
return DL;
380-
}
381-
382369
public:
383370
void initialize(int stage) override;
384371
void deleteEntities(MacNodeId nodeId) override;

src/simu5g/stack/pdcp/LtePdcpEnbD2D.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ MacCid LtePdcpEnbD2D::analyzePacket(inet::Packet *pkt)
4343
// using D2D, set D2D direction. Otherwise, set UL direction
4444
srcId = binder_->getMacNodeId(srcAddr);
4545
destId = binder_->getMacNodeId(destAddr); // get final destination
46-
lteInfo->setDirection(getDirection());
4746

4847
// check if src and dest of the flow are D2D-capable (currently in IM)
4948
if (getNodeTypeById(srcId) == UE && getNodeTypeById(destId) == UE && binder_->getD2DCapability(srcId, destId)) {

src/simu5g/stack/pdcp/LtePdcpUeD2D.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class LtePdcpUeD2D : public LtePdcpUe
3939

4040
MacNodeId getDestId(inet::Ptr<FlowControlInfo> lteInfo) override;
4141

42-
using LtePdcpUe::getDirection; // base class variant: return direction for communication with eNB
4342
// additional getDirection method determining if D2D communication is available to a specific destination
4443
Direction getDirection(MacNodeId destId)
4544
{

src/simu5g/stack/pdcp/NrPdcpEnb.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ MacCid NrPdcpEnb::analyzePacket(inet::Packet *pkt)
4848
// using D2D, set D2D direction. Otherwise, set UL direction
4949
srcId = (lteInfo->getUseNR()) ? binder_->getNrMacNodeId(srcAddr) : binder_->getMacNodeId(srcAddr);
5050
destId = (lteInfo->getUseNR()) ? binder_->getNrMacNodeId(destAddr) : binder_->getMacNodeId(destAddr); // get final destination
51-
lteInfo->setDirection(getDirection());
5251

5352
// check if src and dest of the flow are D2D-capable UEs (currently in IM)
5453
if (getNodeTypeById(srcId) == UE && getNodeTypeById(destId) == UE && binder_->getD2DCapability(srcId, destId)) {

0 commit comments

Comments
 (0)