fixed logging context in LteTest entities

This commit is contained in:
Nicola Baldo
2015-04-13 14:38:23 +02:00
parent 0e06d19022
commit e1931bbd3a
3 changed files with 15 additions and 2 deletions

View File

@@ -150,6 +150,8 @@ LteSimpleHelper::InstallSingleEnbDevice (Ptr<Node> n)
m_enbMac = CreateObject<LteTestMac> ();
m_enbMac->SetDevice (enbDev);
m_enbRrc->SetDevice (enbDev);
enbDev->SetReceiveCallback (MakeCallback (&LteTestMac::Receive, m_enbMac));
// Connect SAPs: RRC <-> PDCP <-> RLC <-> MAC

View File

@@ -20,6 +20,7 @@
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/node.h"
#include "ns3/lte-rlc-header.h"
#include "ns3/lte-rlc-am-header.h"
@@ -72,6 +73,12 @@ LteTestRrc::DoDispose ()
delete m_pdcpSapUser;
}
void
LteTestRrc::SetDevice (Ptr<NetDevice> device)
{
m_device = device;
}
void
LteTestRrc::SetLtePdcpSapProvider (LtePdcpSapProvider* s)
{
@@ -198,7 +205,7 @@ LteTestRrc::Start ()
p.lcid = 222;
p.pdcpSdu = Create<Packet> (m_pduSize);
Simulator::ScheduleNow (&LtePdcpSapProvider::TransmitPdcpSdu, m_pdcpSapProvider, p);
Simulator::ScheduleWithContext (m_device->GetNode ()->GetId (), Seconds (0), &LtePdcpSapProvider::TransmitPdcpSdu, m_pdcpSapProvider, p);
m_nextPdu = Simulator::Schedule (m_arrivalTime, &LteTestRrc::Start, this);
// Simulator::Run ();
}
@@ -450,7 +457,7 @@ void
LteTestMac::SendTxOpportunity (Time time, uint32_t bytes)
{
NS_LOG_FUNCTION (this << time << bytes);
Simulator::Schedule (time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, bytes, 0, 0);
Simulator::ScheduleWithContext (m_device->GetNode ()->GetId (), time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, bytes, 0, 0);
if (m_txOpportunityMode == RANDOM_MODE)
{
if (m_txOppTime != Seconds (0))

View File

@@ -82,6 +82,8 @@ class LteTestRrc : public Object
void SetArrivalTime (Time arrivalTime);
void SetPduSize (uint32_t pduSize);
void SetDevice (Ptr<NetDevice> device);
private:
// Interface forwarded by LtePdcpSapUser
virtual void DoReceivePdcpSdu (LtePdcpSapUser::ReceivePdcpSduParameters params);
@@ -101,6 +103,8 @@ class LteTestRrc : public Object
EventId m_nextPdu;
Time m_arrivalTime;
uint32_t m_pduSize;
Ptr<NetDevice> m_device;
};
/////////////////////////////////////////////////////////////////////