merge
authorMarco Miozzo <marco.miozzo@cttc.es>
Thu, 24 Jan 2013 13:58:26 +0100
changeset 9639 76c7261da683
parent 9638 50fa71b511ed (current diff)
parent 9637 9a6e5e0c3da8 (diff)
child 9641 56061c8a4048
merge
--- a/src/lte/model/lte-enb-phy.cc	Thu Jan 24 13:57:59 2013 +0100
+++ b/src/lte/model/lte-enb-phy.cc	Thu Jan 24 13:58:26 2013 +0100
@@ -200,13 +200,13 @@
                    "The downlink LteSpectrumPhy associated to this LtePhy",
                    TypeId::ATTR_GET,
                    PointerValue (),
-                   MakePointerAccessor (&LteEnbPhy::m_downlinkSpectrumPhy),
+                   MakePointerAccessor (&LteEnbPhy::GetDlSpectrumPhy),
                    MakePointerChecker <LteSpectrumPhy> ())
     .AddAttribute ("UlSpectrumPhy",
                    "The uplink LteSpectrumPhy associated to this LtePhy",
                    TypeId::ATTR_GET,
                    PointerValue (),
-                   MakePointerAccessor (&LteEnbPhy::m_uplinkSpectrumPhy),
+                   MakePointerAccessor (&LteEnbPhy::GetUlSpectrumPhy),
                    MakePointerChecker <LteSpectrumPhy> ())
   ;
   return tid;
@@ -319,7 +319,17 @@
   return (m_macChTtiDelay);
 }
 
+Ptr<LteSpectrumPhy>
+LteEnbPhy::GetDlSpectrumPhy () const
+{
+  return m_downlinkSpectrumPhy;
+}
 
+Ptr<LteSpectrumPhy>
+LteEnbPhy::GetUlSpectrumPhy () const
+{
+  return m_uplinkSpectrumPhy;
+}
 
 bool
 LteEnbPhy::AddUePhy (uint16_t rnti)
--- a/src/lte/model/lte-enb-phy.h	Thu Jan 24 13:57:59 2013 +0100
+++ b/src/lte/model/lte-enb-phy.h	Thu Jan 24 13:58:26 2013 +0100
@@ -126,6 +126,17 @@
   uint8_t GetMacChDelay (void) const;
 
   /**
+   * \return a pointer to the LteSpectrumPhy instance relative to the downlink
+   */
+  Ptr<LteSpectrumPhy> GetDlSpectrumPhy () const;
+
+  /**
+   * \return a pointer to the LteSpectrumPhy instance relative to the uplink
+   */
+  Ptr<LteSpectrumPhy> GetUlSpectrumPhy () const;
+  
+
+  /**
    * \brief set the resource blocks (a.k.a. sub channels) to be used in the downlink for transmission
    * 
    * \param mask a vector of integers, if the i-th value is j it means
--- a/src/lte/model/lte-ue-phy.cc	Thu Jan 24 13:57:59 2013 +0100
+++ b/src/lte/model/lte-ue-phy.cc	Thu Jan 24 13:58:26 2013 +0100
@@ -227,13 +227,13 @@
                    "The downlink LteSpectrumPhy associated to this LtePhy",
                    TypeId::ATTR_GET,
                    PointerValue (),
-                   MakePointerAccessor (&LteUePhy::m_downlinkSpectrumPhy),
+                   MakePointerAccessor (&LteUePhy::GetDlSpectrumPhy),
                    MakePointerChecker <LteSpectrumPhy> ())
     .AddAttribute ("UlSpectrumPhy",
                    "The uplink LteSpectrumPhy associated to this LtePhy",
                    TypeId::ATTR_GET,
                    PointerValue (),
-                   MakePointerAccessor (&LteUePhy::m_uplinkSpectrumPhy),
+                   MakePointerAccessor (&LteUePhy::GetUlSpectrumPhy),
                    MakePointerChecker <LteSpectrumPhy> ())
   ;
   return tid;
@@ -310,6 +310,18 @@
   return (m_macChTtiDelay);
 }
 
+Ptr<LteSpectrumPhy>
+LteUePhy::GetDlSpectrumPhy () const
+{
+  return m_downlinkSpectrumPhy;
+}
+
+Ptr<LteSpectrumPhy>
+LteUePhy::GetUlSpectrumPhy () const
+{
+  return m_uplinkSpectrumPhy;
+}
+
 void
 LteUePhy::DoSendMacPdu (Ptr<Packet> p)
 {
--- a/src/lte/model/lte-ue-phy.h	Thu Jan 24 13:57:59 2013 +0100
+++ b/src/lte/model/lte-ue-phy.h	Thu Jan 24 13:58:26 2013 +0100
@@ -120,6 +120,16 @@
    */
   uint8_t GetMacChDelay (void) const;
 
+  /**
+   * \return a pointer to the LteSpectrumPhy instance relative to the downlink
+   */
+  Ptr<LteSpectrumPhy> GetDlSpectrumPhy () const;
+
+  /**
+   * \return a pointer to the LteSpectrumPhy instance relative to the uplink
+   */
+  Ptr<LteSpectrumPhy> GetUlSpectrumPhy () const;
+
 
   /**
    * \brief Create the PSD for the TX
--- a/src/lte/test/test-asn1-encoding.cc	Thu Jan 24 13:57:59 2013 +0100
+++ b/src/lte/test/test-asn1-encoding.cc	Thu Jan 24 13:58:26 2013 +0100
@@ -102,7 +102,6 @@
 
 RrcHeaderTestCase :: RrcHeaderTestCase(std::string s) : TestCase(s)
 {
-  packet = Create<Packet> ();
 }
 
 LteRrcSap::RadioResourceConfigDedicated
@@ -244,12 +243,13 @@
 class RrcConnectionRequestTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionRequestTestCase ();
+  RrcConnectionRequestTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionRequestTestCase::RrcConnectionRequestTestCase () : RrcHeaderTestCase ("Testing RrcConnectionRequest")
+RrcConnectionRequestTestCase::RrcConnectionRequestTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionRequest")
 {
+  packet = pkt;
 }
 
 void
@@ -258,7 +258,7 @@
   NS_LOG_DEBUG ("============= RrcConnectionRequestTestCase ===========");
 
   LteRrcSap::RrcConnectionRequest msg;
-  msg.ueIdentity = 0x83fecafeca;
+  msg.ueIdentity = 0x83fecafecaULL;
 
   RrcConnectionRequestHeader source;
   source.SetMessage (msg);
@@ -288,12 +288,13 @@
 class RrcConnectionSetupTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionSetupTestCase ();
+  RrcConnectionSetupTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionSetupTestCase::RrcConnectionSetupTestCase () : RrcHeaderTestCase ("Testing RrcConnectionSetupTestCase")
+RrcConnectionSetupTestCase::RrcConnectionSetupTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionSetupTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -334,12 +335,13 @@
 class RrcConnectionSetupCompleteTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionSetupCompleteTestCase ();
+  RrcConnectionSetupCompleteTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionSetupCompleteTestCase::RrcConnectionSetupCompleteTestCase () : RrcHeaderTestCase ("Testing RrcConnectionSetupCompleteTestCase")
+RrcConnectionSetupCompleteTestCase::RrcConnectionSetupCompleteTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionSetupCompleteTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -377,13 +379,14 @@
 class RrcConnectionReconfigurationCompleteTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionReconfigurationCompleteTestCase ();
+  RrcConnectionReconfigurationCompleteTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionReconfigurationCompleteTestCase::RrcConnectionReconfigurationCompleteTestCase ()
+RrcConnectionReconfigurationCompleteTestCase::RrcConnectionReconfigurationCompleteTestCase (Ptr<Packet> pkt)
   : RrcHeaderTestCase ("Testing RrcConnectionReconfigurationCompleteTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -421,13 +424,14 @@
 class RrcConnectionReconfigurationTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionReconfigurationTestCase ();
+  RrcConnectionReconfigurationTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionReconfigurationTestCase::RrcConnectionReconfigurationTestCase ()
+RrcConnectionReconfigurationTestCase::RrcConnectionReconfigurationTestCase (Ptr<Packet> pkt)
   : RrcHeaderTestCase ("Testing RrcConnectionReconfigurationTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -530,12 +534,13 @@
 class HandoverPreparationInfoTestCase : public RrcHeaderTestCase
 {
 public:
-  HandoverPreparationInfoTestCase ();
+  HandoverPreparationInfoTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-HandoverPreparationInfoTestCase::HandoverPreparationInfoTestCase () : RrcHeaderTestCase ("Testing HandoverPreparationInfoTestCase")
+HandoverPreparationInfoTestCase::HandoverPreparationInfoTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing HandoverPreparationInfoTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -590,12 +595,13 @@
 class RrcConnectionReestablishmentRequestTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionReestablishmentRequestTestCase ();
+  RrcConnectionReestablishmentRequestTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionReestablishmentRequestTestCase::RrcConnectionReestablishmentRequestTestCase () : RrcHeaderTestCase ("Testing RrcConnectionReestablishmentRequestTestCase")
+RrcConnectionReestablishmentRequestTestCase::RrcConnectionReestablishmentRequestTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionReestablishmentRequestTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -637,12 +643,13 @@
 class RrcConnectionReestablishmentTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionReestablishmentTestCase ();
+  RrcConnectionReestablishmentTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionReestablishmentTestCase::RrcConnectionReestablishmentTestCase () : RrcHeaderTestCase ("Testing RrcConnectionReestablishmentTestCase")
+RrcConnectionReestablishmentTestCase::RrcConnectionReestablishmentTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionReestablishmentTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -682,12 +689,13 @@
 class RrcConnectionReestablishmentCompleteTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionReestablishmentCompleteTestCase ();
+  RrcConnectionReestablishmentCompleteTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionReestablishmentCompleteTestCase::RrcConnectionReestablishmentCompleteTestCase () : RrcHeaderTestCase ("Testing RrcConnectionReestablishmentCompleteTestCase")
+RrcConnectionReestablishmentCompleteTestCase::RrcConnectionReestablishmentCompleteTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionReestablishmentCompleteTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -725,12 +733,13 @@
 class RrcConnectionRejectTestCase : public RrcHeaderTestCase
 {
 public:
-  RrcConnectionRejectTestCase ();
+  RrcConnectionRejectTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-RrcConnectionRejectTestCase::RrcConnectionRejectTestCase () : RrcHeaderTestCase ("Testing RrcConnectionRejectTestCase")
+RrcConnectionRejectTestCase::RrcConnectionRejectTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing RrcConnectionRejectTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -768,12 +777,13 @@
 class MeasurementReportTestCase : public RrcHeaderTestCase
 {
 public:
-  MeasurementReportTestCase ();
+  MeasurementReportTestCase (Ptr<Packet> pkt);
   virtual void DoRun (void);
 };
 
-MeasurementReportTestCase::MeasurementReportTestCase () : RrcHeaderTestCase ("Testing MeasurementReportTestCase")
+MeasurementReportTestCase::MeasurementReportTestCase (Ptr<Packet> pkt) : RrcHeaderTestCase ("Testing MeasurementReportTestCase")
 {
+  packet = pkt;
 }
 
 void
@@ -882,18 +892,22 @@
   : TestSuite ("test-asn1-encoding", UNIT)
 {
   Packet::EnablePrinting ();
+  Ptr<Packet> packet = Create<Packet>();
+  
   NS_LOG_FUNCTION (this);
-  AddTestCase (new RrcConnectionRequestTestCase);
-  AddTestCase (new RrcConnectionSetupTestCase);
-  AddTestCase (new RrcConnectionSetupCompleteTestCase);
-  AddTestCase (new RrcConnectionReconfigurationCompleteTestCase);
-  AddTestCase (new RrcConnectionReconfigurationTestCase);
-  AddTestCase (new HandoverPreparationInfoTestCase);
-  AddTestCase (new RrcConnectionReestablishmentRequestTestCase);
-  AddTestCase (new RrcConnectionReestablishmentTestCase);
-  AddTestCase (new RrcConnectionReestablishmentCompleteTestCase);
-  AddTestCase (new RrcConnectionRejectTestCase);
-  AddTestCase (new MeasurementReportTestCase);
+  AddTestCase (new RrcConnectionRequestTestCase(packet));
+  AddTestCase (new RrcConnectionSetupTestCase(packet));
+  AddTestCase (new RrcConnectionSetupCompleteTestCase(packet));
+  AddTestCase (new RrcConnectionReconfigurationCompleteTestCase(packet));
+  AddTestCase (new RrcConnectionReconfigurationTestCase(packet));
+  AddTestCase (new HandoverPreparationInfoTestCase(packet));
+  AddTestCase (new RrcConnectionReestablishmentRequestTestCase(packet));
+  AddTestCase (new RrcConnectionReestablishmentTestCase(packet));
+  AddTestCase (new RrcConnectionReestablishmentCompleteTestCase(packet));
+  AddTestCase (new RrcConnectionRejectTestCase(packet));
+  AddTestCase (new MeasurementReportTestCase(packet));
+  
+  packet.~Ptr();
 }
 
 Asn1EncodingSuite asn1EncodingSuite;