From 8cbec725118df81008c326bd6e7dfd62182560fc Mon Sep 17 00:00:00 2001 From: Natale Patriciello Date: Mon, 11 Mar 2019 16:16:11 +0100 Subject: [PATCH] lte: fixed reviewer comments for p2p helper --- src/lte/helper/point-to-point-epc-helper.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lte/helper/point-to-point-epc-helper.cc b/src/lte/helper/point-to-point-epc-helper.cc index b60c87a10..a064fb9b7 100644 --- a/src/lte/helper/point-to-point-epc-helper.cc +++ b/src/lte/helper/point-to-point-epc-helper.cc @@ -479,8 +479,8 @@ PointToPointEpcHelper::AddX2Interface (Ptr enb1, Ptr enb2) Ptr enb1X2 = enb1->GetObject (); Ptr enb2X2 = enb2->GetObject (); - Ptr enb1LteDev = enb1->GetDevice (0); // What if at position 0 we have another device than LTE? - Ptr enb2LteDev = enb2->GetDevice (0); // What if at position 0 we have another device than LTE? + Ptr enb1LteDev = enb1->GetDevice (0); + Ptr enb2LteDev = enb2->GetDevice (0); DoAddX2Interface (enb1X2, enb1LteDev, enb1X2Address, enb2X2, enb2LteDev, enb2X2Address); } @@ -495,6 +495,10 @@ PointToPointEpcHelper::DoAddX2Interface (const Ptr &enb1X2, const Ptr enb1LteDevice = enb1LteDev->GetObject (); Ptr enb2LteDevice = enb2LteDev->GetObject (); + + NS_ABORT_MSG_IF (enb1LteDevice == nullptr , "Unable to find LteEnbNetDevice for the first eNB"); + NS_ABORT_MSG_IF (enb2LteDevice == nullptr , "Unable to find LteEnbNetDevice for the second eNB"); + uint16_t enb1CellId = enb1LteDevice->GetCellId (); uint16_t enb2CellId = enb2LteDevice->GetCellId (); @@ -566,10 +570,9 @@ PointToPointEpcHelper::DoActivateEpsBearerForUe (const Ptr &ueDevice, { NS_LOG_FUNCTION (this); Ptr ueLteDevice = ueDevice->GetObject (); - if (ueLteDevice) - { - Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft); - } + NS_ABORT_MSG_IF (ueLteDevice == nullptr , "Unable to find LteUeNetDevice while activating the EPS bearer"); + + Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft); } Ptr