Polish code according to codereview
This commit is contained in:
@@ -56,11 +56,23 @@ public:
|
||||
friend bool operator < (const ImsiLcidPair_t &a, const ImsiLcidPair_t &b);
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Parameters for configuring the UE
|
||||
*/
|
||||
struct LteUeConfig_t
|
||||
{
|
||||
uint16_t m_rnti;
|
||||
/**
|
||||
* When false means that the message is inteded foro configuring a new UE
|
||||
*/
|
||||
bool m_reconfigureFlag;
|
||||
/**
|
||||
* Transmission mode [1..7] (i.e., SISO, MIMO, etc.)
|
||||
*/
|
||||
uint8_t m_transmissionMode;
|
||||
/**
|
||||
* Srs Configuration index for UE specific SRS, see section 8.2 of TS 36.213
|
||||
*/
|
||||
uint16_t m_srsConfigurationIndex;
|
||||
|
||||
public:
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <ns3/ff-mac-common.h>
|
||||
#include <ns3/eps-bearer.h>
|
||||
#include <ns3/lte-common.h>
|
||||
//#include <ns3/ff-mac-csched-sap.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
* \param rnti the RNTI of the user
|
||||
* \param txMode the SRS Configuration Index of the user
|
||||
*/
|
||||
virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI) = 0;
|
||||
virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCi) = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
virtual void SendLteControlMessage (Ptr<LteControlMessage> msg);
|
||||
virtual uint8_t GetMacChTtiDelay ();
|
||||
virtual void SetTransmissionMode (uint16_t rnti, uint8_t txMode);
|
||||
virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI);
|
||||
virtual void SetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
|
||||
|
||||
|
||||
private:
|
||||
@@ -108,9 +108,9 @@ EnbMemberLteEnbPhySapProvider::SetTransmissionMode (uint16_t rnti, uint8_t txMo
|
||||
}
|
||||
|
||||
void
|
||||
EnbMemberLteEnbPhySapProvider::SetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI)
|
||||
EnbMemberLteEnbPhySapProvider::SetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi)
|
||||
{
|
||||
m_phy->DoSetSrsConfigurationIndex (rnti, srsCI);
|
||||
m_phy->DoSetSrsConfigurationIndex (rnti, srcCi);
|
||||
}
|
||||
|
||||
|
||||
@@ -652,19 +652,19 @@ LteEnbPhy::DequeueUlDci (void)
|
||||
}
|
||||
|
||||
void
|
||||
LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI)
|
||||
LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_srsPeriodicity = GetSrsPeriodicity (srsCI);
|
||||
NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srsCI) << " CI " << srsCI);
|
||||
m_srsPeriodicity = GetSrsPeriodicity (srcCi);
|
||||
NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi);
|
||||
std::map <uint16_t,uint16_t>::iterator it = m_srsCounter.find (rnti);
|
||||
if (it != m_srsCounter.end ())
|
||||
{
|
||||
(*it).second = GetSrsSubframeOffset (srsCI) + 1;
|
||||
(*it).second = GetSrsSubframeOffset (srcCi) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_srsCounter.insert (std::pair<uint16_t, uint16_t> (rnti, GetSrsSubframeOffset (srsCI) + 1));
|
||||
m_srsCounter.insert (std::pair<uint16_t, uint16_t> (rnti, GetSrsSubframeOffset (srcCi) + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
virtual void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode);
|
||||
|
||||
virtual void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srsCI);
|
||||
virtual void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi);
|
||||
|
||||
virtual uint8_t DoGetMacChTtiDelay ();
|
||||
|
||||
@@ -133,11 +133,6 @@ public:
|
||||
*/
|
||||
void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue);
|
||||
|
||||
/**
|
||||
* \brief Send the control message
|
||||
* \param msg the message to send
|
||||
*/
|
||||
// virtual void SendLteControlMessage (Ptr<LteControlMessage> msg); // legacy
|
||||
/**
|
||||
* \brief Receive the control message
|
||||
* \param msg the received message
|
||||
@@ -164,8 +159,17 @@ public:
|
||||
bool AddUePhy (uint16_t rnti, Ptr<LteUePhy> phy);
|
||||
|
||||
bool DeleteUePhy (uint16_t rnti);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Send the PDCCH and PCFICH in the first 3 symbols
|
||||
* \param ctrlMsgList the list of control messages of PDCCH
|
||||
*/
|
||||
void SendControlChannels (std::list<Ptr<LteControlMessage> > ctrlMsgList);
|
||||
|
||||
/**
|
||||
* \brief Send the PDSCH
|
||||
* \param pb the PacketBurst to be sent
|
||||
*/
|
||||
void SendDataChannels (Ptr<PacketBurst> pb);
|
||||
|
||||
/**
|
||||
|
||||
@@ -506,9 +506,10 @@ LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success)
|
||||
// /////////////////////////////////////////
|
||||
|
||||
// from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity
|
||||
uint16_t SrsPeriodicity[9] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
|
||||
uint16_t SrsCiLow[9] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
|
||||
uint16_t SrsCiHigh[9] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
|
||||
#define SRS_ENTRIES 9
|
||||
uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
|
||||
uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
|
||||
uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636};
|
||||
|
||||
void
|
||||
LteEnbRrc::SetCellId (uint16_t cellId)
|
||||
@@ -552,22 +553,24 @@ LteEnbRrc::GetNewSrsConfigurationIndex ()
|
||||
|
||||
return 0;
|
||||
}
|
||||
NS_LOG_DEBUG (this << " SRS p " << SrsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
|
||||
if (m_ueSrsConfigurationIndexSet.size () == SrsPeriodicity[m_srsCurrentPeriodicityId])
|
||||
NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES);
|
||||
NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ());
|
||||
if (m_ueSrsConfigurationIndexSet.size () == g_srsPeriodicity[m_srsCurrentPeriodicityId])
|
||||
{
|
||||
NS_LOG_DEBUG (this << " SRS reconfigure CIs " << SrsPeriodicity[m_srsCurrentPeriodicityId] << " to " << SrsPeriodicity[m_srsCurrentPeriodicityId+1] << " at " << Simulator::Now ());
|
||||
// NS_LOG_DEBUG (this << " SRS reconfigure CIs " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " to " << g_srsPeriodicity[m_srsCurrentPeriodicityId+1] << " at " << Simulator::Now ());
|
||||
// increase the current periocity for having enough CIs
|
||||
m_ueSrsConfigurationIndexSet.clear ();
|
||||
m_srsCurrentPeriodicityId++;
|
||||
NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES);
|
||||
// update all the UE's CI
|
||||
uint16_t srsCI = SrsCiLow[m_srsCurrentPeriodicityId];
|
||||
uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId];
|
||||
std::map<uint16_t, Ptr<UeInfo> >::iterator it;
|
||||
for (it = m_ueMap.begin (); it != m_ueMap.end (); it++)
|
||||
{
|
||||
(*it).second->SetSrsConfigurationIndex (srsCI);
|
||||
m_ueSrsConfigurationIndexSet.insert (srsCI);
|
||||
m_lastAllocatedConfigurationIndex = srsCI;
|
||||
srsCI++;
|
||||
(*it).second->SetSrsConfigurationIndex (srcCi);
|
||||
m_ueSrsConfigurationIndexSet.insert (srcCi);
|
||||
m_lastAllocatedConfigurationIndex = srcCi;
|
||||
srcCi++;
|
||||
// send update to peer RRC
|
||||
LteUeConfig_t ueConfig;
|
||||
ueConfig.m_rnti = (*it).first;
|
||||
@@ -584,8 +587,8 @@ LteEnbRrc::GetNewSrsConfigurationIndex ()
|
||||
{
|
||||
// find a CI from the available ones
|
||||
std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin ();
|
||||
NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << SrsCiHigh[m_srsCurrentPeriodicityId]);
|
||||
if ((*rit) <= SrsCiHigh[m_srsCurrentPeriodicityId])
|
||||
NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]);
|
||||
if ((*rit) <= g_srsCiHigh[m_srsCurrentPeriodicityId])
|
||||
{
|
||||
// got it from the upper bound
|
||||
m_lastAllocatedConfigurationIndex = (*rit) + 1;
|
||||
@@ -594,13 +597,13 @@ LteEnbRrc::GetNewSrsConfigurationIndex ()
|
||||
else
|
||||
{
|
||||
// look for released ones
|
||||
for (uint16_t srsCI = SrsCiLow[m_srsCurrentPeriodicityId]; srsCI < SrsCiHigh[m_srsCurrentPeriodicityId]; srsCI++)
|
||||
for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++)
|
||||
{
|
||||
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srsCI);
|
||||
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
|
||||
if (it==m_ueSrsConfigurationIndexSet.end ())
|
||||
{
|
||||
m_lastAllocatedConfigurationIndex = srsCI;
|
||||
m_ueSrsConfigurationIndexSet.insert (srsCI);
|
||||
m_lastAllocatedConfigurationIndex = srcCi;
|
||||
m_ueSrsConfigurationIndexSet.insert (srcCi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -612,13 +615,14 @@ LteEnbRrc::GetNewSrsConfigurationIndex ()
|
||||
|
||||
|
||||
void
|
||||
LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srsCI)
|
||||
LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srcCi)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << srsCI);
|
||||
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srsCI);
|
||||
NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srsCI);
|
||||
NS_LOG_FUNCTION (this << srcCi);
|
||||
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi);
|
||||
NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi);
|
||||
m_ueSrsConfigurationIndexSet.erase (it);
|
||||
if (m_ueSrsConfigurationIndexSet.size () < SrsPeriodicity[m_srsCurrentPeriodicityId - 1])
|
||||
NS_ASSERT (m_srsCurrentPeriodicityId > 1);
|
||||
if (m_ueSrsConfigurationIndexSet.size () < g_srsPeriodicity[m_srsCurrentPeriodicityId - 1])
|
||||
{
|
||||
// reduce the periodicity
|
||||
m_ueSrsConfigurationIndexSet.clear ();
|
||||
@@ -631,14 +635,14 @@ LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srsCI)
|
||||
else
|
||||
{
|
||||
// update all the UE's CI
|
||||
uint16_t srsCI = SrsCiLow[m_srsCurrentPeriodicityId];
|
||||
uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId];
|
||||
std::map<uint16_t, Ptr<UeInfo> >::iterator it;
|
||||
for (it = m_ueMap.begin (); it != m_ueMap.end (); it++)
|
||||
{
|
||||
(*it).second->SetSrsConfigurationIndex (srsCI);
|
||||
m_ueSrsConfigurationIndexSet.insert (srsCI);
|
||||
m_lastAllocatedConfigurationIndex = srsCI;
|
||||
srsCI++;
|
||||
(*it).second->SetSrsConfigurationIndex (srcCi);
|
||||
m_ueSrsConfigurationIndexSet.insert (srcCi);
|
||||
m_lastAllocatedConfigurationIndex = srcCi;
|
||||
srcCi++;
|
||||
// send update to peer RRC
|
||||
LteUeConfig_t ueConfig;
|
||||
ueConfig.m_rnti = (*it).first;
|
||||
@@ -699,7 +703,6 @@ void
|
||||
LteEnbRrc::ConfigureNewUe (uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// at this stage used only by the scheduler for updating txMode
|
||||
// retrieve UE info
|
||||
std::map<uint16_t, Ptr<UeInfo> >::iterator it;
|
||||
it = m_ueMap.find (rnti);
|
||||
|
||||
@@ -231,8 +231,11 @@ public:
|
||||
*/
|
||||
void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
|
||||
|
||||
// void DoStart ();
|
||||
|
||||
/**
|
||||
* Configure the UE peer RRC with all the correspondet info
|
||||
*
|
||||
* \param rnti the RNTI of the UE to be configured
|
||||
*/
|
||||
void ConfigureNewUe (uint16_t rnti);
|
||||
|
||||
|
||||
@@ -250,7 +253,7 @@ private:
|
||||
Ptr<UeInfo> GetUeInfo (uint16_t rnti);
|
||||
void RemoveUeInfo (uint16_t rnti);
|
||||
uint16_t GetNewSrsConfigurationIndex (void);
|
||||
void RemoveSrsConfigurationIndex (uint16_t srsCI);
|
||||
void RemoveSrsConfigurationIndex (uint16_t srcCi);
|
||||
|
||||
Callback <void, Ptr<Packet> > m_forwardUpCallback;
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ LtePhy::DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
|
||||
|
||||
|
||||
uint16_t
|
||||
LtePhy::GetSrsPeriodicity (uint16_t srsCI) const
|
||||
LtePhy::GetSrsPeriodicity (uint16_t srcCi) const
|
||||
{
|
||||
// from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity
|
||||
uint16_t SrsPeriodicity[9] = {0, 2, 5, 10, 20, 40, 80, 160, 320};
|
||||
@@ -222,7 +222,7 @@ LtePhy::GetSrsPeriodicity (uint16_t srsCI) const
|
||||
uint8_t i;
|
||||
for (i = 8; i > 0; i --)
|
||||
{
|
||||
if ((srsCI>=SrsCiLow[i])&&(srsCI<=SrsCiHigh[i]))
|
||||
if ((srcCi>=SrsCiLow[i])&&(srcCi<=SrsCiHigh[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ LtePhy::GetSrsPeriodicity (uint16_t srsCI) const
|
||||
}
|
||||
|
||||
uint16_t
|
||||
LtePhy::GetSrsSubframeOffset (uint16_t srsCI) const
|
||||
LtePhy::GetSrsSubframeOffset (uint16_t srcCi) const
|
||||
{
|
||||
// from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity
|
||||
uint16_t SrsSubframeOffset[9] = {0, 0, 2, 7, 17, 37, 77, 157, 317};
|
||||
@@ -240,12 +240,12 @@ LtePhy::GetSrsSubframeOffset (uint16_t srsCI) const
|
||||
uint8_t i;
|
||||
for (i = 8; i > 0; i --)
|
||||
{
|
||||
if ((srsCI>=SrsCiLow[i])&&(srsCI<=SrsCiHigh[i]))
|
||||
if ((srcCi>=SrsCiLow[i])&&(srcCi<=SrsCiHigh[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (srsCI - SrsSubframeOffset[i]);
|
||||
return (srcCi - SrsSubframeOffset[i]);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -199,15 +199,15 @@ public:
|
||||
|
||||
/**
|
||||
* \returns the SRS periodicity (see Table 8.2-1 of 36.213)
|
||||
* \param srsCI the SRS Configuration Index
|
||||
* \param srcCi the SRS Configuration Index
|
||||
*/
|
||||
uint16_t GetSrsPeriodicity (uint16_t srsCI) const;
|
||||
uint16_t GetSrsPeriodicity (uint16_t srcCi) const;
|
||||
|
||||
/**
|
||||
* \returns the SRS Subframe offset (see Table 8.2-1 of 36.213)
|
||||
* \param srsCI the SRS Configuration Index
|
||||
* \param srcCi the SRS Configuration Index
|
||||
*/
|
||||
uint16_t GetSrsSubframeOffset (uint16_t srsCI) const;
|
||||
uint16_t GetSrsSubframeOffset (uint16_t srcCi) const;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,7 +55,9 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* This SinrProcessor averages the calculated SINR over time.
|
||||
* The LteCtrlSinrChunkProcessor averages the calculated SINR over time
|
||||
* for the Ctrl frame and therefore in charge of generating the CQI starting
|
||||
* from the reference signals.
|
||||
*
|
||||
*/
|
||||
class LteCtrlSinrChunkProcessor : public LteSinrChunkProcessor
|
||||
@@ -75,7 +77,10 @@ private:
|
||||
|
||||
|
||||
/**
|
||||
* This SinrProcessor averages the calculated SINR over time for Phy error model
|
||||
* The LteDataSinrChunkProcessor averages the calculated SINR over time for
|
||||
* data frame and therefore in charge of generating the sinr values for
|
||||
* evaluating the errors of data packets. Might be used also for generating
|
||||
* CQI based on data in case any LtePhy is attached.
|
||||
*
|
||||
*/
|
||||
class LteDataSinrChunkProcessor : public LteSinrChunkProcessor
|
||||
|
||||
@@ -114,8 +114,11 @@ std::ostream& operator<< (std::ostream& os, LteSpectrumPhy::State s)
|
||||
case LteSpectrumPhy::IDLE:
|
||||
os << "IDLE";
|
||||
break;
|
||||
case LteSpectrumPhy::RX:
|
||||
os << "RX";
|
||||
case LteSpectrumPhy::RX_DATA:
|
||||
os << "RX_DATA";
|
||||
break;
|
||||
case LteSpectrumPhy::RX_CTRL:
|
||||
os << "RX_CTRL";
|
||||
break;
|
||||
case LteSpectrumPhy::TX:
|
||||
os << "TX";
|
||||
@@ -303,7 +306,8 @@ LteSpectrumPhy::StartTx (Ptr<PacketBurst> pb)
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
case RX:
|
||||
case RX_DATA:
|
||||
case RX_CTRL:
|
||||
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
|
||||
@@ -363,7 +367,8 @@ LteSpectrumPhy::StartTxDataFrame (Ptr<PacketBurst> pb, std::list<Ptr<LteControlM
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
case RX:
|
||||
case RX_DATA:
|
||||
case RX_CTRL:
|
||||
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
|
||||
@@ -418,7 +423,8 @@ LteSpectrumPhy::StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgLi
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
case RX:
|
||||
case RX_DATA:
|
||||
case RX_CTRL:
|
||||
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
|
||||
@@ -473,7 +479,8 @@ LteSpectrumPhy::StartTxUlSrsFrame ()
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
case RX:
|
||||
case RX_DATA:
|
||||
case RX_CTRL:
|
||||
NS_FATAL_ERROR ("cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
|
||||
@@ -571,7 +578,7 @@ LteSpectrumPhy::StartRx (Ptr<SpectrumSignalParameters> spectrumRxParams)
|
||||
}
|
||||
else
|
||||
{
|
||||
// other type of signal (cuold be 3G, GSM, whatever) -> interference
|
||||
// other type of signal (could be 3G, GSM, whatever) -> interference
|
||||
m_interferenceData->AddSignal (rxPsd, duration);
|
||||
m_interferenceCtrl->AddSignal (rxPsd, duration);
|
||||
}
|
||||
@@ -588,9 +595,11 @@ LteSpectrumPhy::StartRxData (Ptr<LteSpectrumSignalParametersDataFrame> params)
|
||||
case TX:
|
||||
NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
|
||||
case RX_CTRL:
|
||||
NS_FATAL_ERROR ("cannot RX Data while receiving control");
|
||||
break;
|
||||
case IDLE:
|
||||
case RX:
|
||||
case RX_DATA:
|
||||
// the behavior is similar when
|
||||
// we're IDLE or RX because we can receive more signals
|
||||
// simultaneously (e.g., at the eNB).
|
||||
@@ -613,7 +622,7 @@ LteSpectrumPhy::StartRxData (Ptr<LteSpectrumSignalParametersDataFrame> params)
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_ASSERT (m_state == RX);
|
||||
NS_ASSERT (m_state == RX_DATA);
|
||||
// sanity check: if there are multiple RX events, they
|
||||
// should occur at the same time and have the same
|
||||
// duration, otherwise the interference calculation
|
||||
@@ -622,7 +631,7 @@ LteSpectrumPhy::StartRxData (Ptr<LteSpectrumSignalParametersDataFrame> params)
|
||||
&& (m_firstRxDuration == params->duration));
|
||||
}
|
||||
|
||||
ChangeState (RX);
|
||||
ChangeState (RX_DATA);
|
||||
if (params->packetBurst)
|
||||
{
|
||||
m_rxPacketBurstList.push_back (params->packetBurst);
|
||||
@@ -662,9 +671,11 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
|
||||
case TX:
|
||||
NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
|
||||
case RX_DATA:
|
||||
NS_FATAL_ERROR ("cannot RX data while receing control");
|
||||
break;
|
||||
case IDLE:
|
||||
case RX:
|
||||
case RX_CTRL:
|
||||
// the behavior is similar when
|
||||
// we're IDLE or RX because we can receive more signals
|
||||
// simultaneously (e.g., at the eNB).
|
||||
@@ -708,7 +719,7 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
|
||||
Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxUlSrs, this);
|
||||
}
|
||||
}
|
||||
else if (m_state == RX)
|
||||
else if (m_state == RX_CTRL)
|
||||
{
|
||||
// sanity check: if there are multiple RX events, they
|
||||
// should occur at the same time and have the same
|
||||
@@ -718,7 +729,7 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
|
||||
&& (m_firstRxDuration == params->duration));
|
||||
}
|
||||
|
||||
ChangeState (RX);
|
||||
ChangeState (RX_CTRL);
|
||||
m_interferenceCtrl->StartRx (params->psd);
|
||||
|
||||
// NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ());
|
||||
@@ -774,7 +785,7 @@ LteSpectrumPhy::EndRxData ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
NS_LOG_LOGIC (this << " state: " << m_state);
|
||||
|
||||
NS_ASSERT (m_state == RX);
|
||||
NS_ASSERT (m_state == RX_DATA);
|
||||
|
||||
// this will trigger CQI calculation and Error Model evaluation
|
||||
// as a side effect, the error model should update the error status of all TBs
|
||||
@@ -856,7 +867,7 @@ LteSpectrumPhy::EndRxDlCtrl ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
NS_LOG_LOGIC (this << " state: " << m_state);
|
||||
|
||||
NS_ASSERT (m_state == RX);
|
||||
NS_ASSERT (m_state == RX_CTRL);
|
||||
|
||||
// this will trigger CQI calculation and Error Model evaluation
|
||||
// as a side effect, the error model should update the error status of all TBs
|
||||
@@ -892,6 +903,7 @@ LteSpectrumPhy::EndRxDlCtrl ()
|
||||
void
|
||||
LteSpectrumPhy::EndRxUlSrs ()
|
||||
{
|
||||
NS_ASSERT (m_state == RX_CTRL);
|
||||
ChangeState (IDLE);
|
||||
m_interferenceCtrl->EndRx ();
|
||||
// nothing to do (used only for SRS at this stage)
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
*/
|
||||
enum State
|
||||
{
|
||||
IDLE, TX, RX
|
||||
IDLE, TX, RX_DATA, RX_CTRL
|
||||
};
|
||||
|
||||
// inherited from Object
|
||||
@@ -344,8 +344,6 @@ private:
|
||||
|
||||
std::list<Ptr<LteControlMessage> > m_txControlMessageList;
|
||||
std::list<Ptr<LteControlMessage> > m_rxControlMessageList;
|
||||
// std::list<DlDciListElement_s> m_rxDlDciBurstList;
|
||||
// std::list<UlDciListElement_s> m_rxUlDciBurstList;
|
||||
|
||||
|
||||
State m_state;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Nicola Baldo <nbaldo@cttc.es>
|
||||
* Modified by Marco Miozzo <mmiozzo@cttc.es> (add data and ctrl diversity)
|
||||
*/
|
||||
|
||||
#include <ns3/log.h>
|
||||
@@ -79,9 +80,9 @@ LteSpectrumSignalParametersDataFrame::Copy ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// Ideally we would use:
|
||||
// return Copy<LteSpectrumSignalParameters> (*this);
|
||||
// return Copy<LteSpectrumSignalParametersDataFrame> (*this);
|
||||
// but for some reason it doesn't work. Another alternative is
|
||||
// return Copy<LteSpectrumSignalParameters> (this);
|
||||
// return Copy<LteSpectrumSignalParametersDataFrame> (this);
|
||||
// but it causes a double creation of the object, hence it is less efficient.
|
||||
// The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h
|
||||
Ptr<LteSpectrumSignalParametersDataFrame> lssp (new LteSpectrumSignalParametersDataFrame (*this), false);
|
||||
@@ -108,9 +109,9 @@ LteSpectrumSignalParametersDlCtrlFrame::Copy ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// Ideally we would use:
|
||||
// return Copy<LteSpectrumSignalParameters> (*this);
|
||||
// return Copy<LteSpectrumSignalParametersDlCtrlFrame> (*this);
|
||||
// but for some reason it doesn't work. Another alternative is
|
||||
// return Copy<LteSpectrumSignalParameters> (this);
|
||||
// return Copy<LteSpectrumSignalParametersDlCtrlFrame> (this);
|
||||
// but it causes a double creation of the object, hence it is less efficient.
|
||||
// The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h
|
||||
Ptr<LteSpectrumSignalParametersDlCtrlFrame> lssp (new LteSpectrumSignalParametersDlCtrlFrame (*this), false);
|
||||
@@ -135,9 +136,9 @@ LteSpectrumSignalParametersUlSrsFrame::Copy ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// Ideally we would use:
|
||||
// return Copy<LteSpectrumSignalParameters> (*this);
|
||||
// return Copy<LteSpectrumSignalParametersUlSrsFrame> (*this);
|
||||
// but for some reason it doesn't work. Another alternative is
|
||||
// return Copy<LteSpectrumSignalParameters> (this);
|
||||
// return Copy<LteSpectrumSignalParametersUlSrsFrame> (this);
|
||||
// but it causes a double creation of the object, hence it is less efficient.
|
||||
// The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h
|
||||
Ptr<LteSpectrumSignalParametersUlSrsFrame> lssp (new LteSpectrumSignalParametersUlSrsFrame (*this), false);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Nicola Baldo <nbaldo@cttc.es>
|
||||
* Modified by Marco Miozzo <mmiozzo@cttc.es> (add data and ctrl diversity)
|
||||
*/
|
||||
|
||||
#ifndef LTE_SPECTRUM_SIGNAL_PARAMETERS_H
|
||||
@@ -23,7 +24,6 @@
|
||||
|
||||
|
||||
#include <ns3/spectrum-signal-parameters.h>
|
||||
// #include <ns3/ff-mac-common.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
/**
|
||||
* \param txMode the transmissionMode of the user
|
||||
*/
|
||||
virtual void SetSrsConfigurationIndex (uint16_t srsCI) = 0;
|
||||
virtual void SetSrsConfigurationIndex (uint16_t srcCi) = 0;
|
||||
|
||||
/**
|
||||
* \brief Send SendLteControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
|
||||
virtual void SendLteControlMessage (Ptr<LteControlMessage> msg);
|
||||
virtual void SetTransmissionMode (uint8_t txMode);
|
||||
virtual void SetSrsConfigurationIndex (uint16_t srsCI);
|
||||
virtual void SetSrsConfigurationIndex (uint16_t srcCi);
|
||||
|
||||
private:
|
||||
LteUePhy* m_phy;
|
||||
@@ -94,9 +94,9 @@ UeMemberLteUePhySapProvider::SetTransmissionMode (uint8_t txMode)
|
||||
}
|
||||
|
||||
void
|
||||
UeMemberLteUePhySapProvider::SetSrsConfigurationIndex (uint16_t srsCI)
|
||||
UeMemberLteUePhySapProvider::SetSrsConfigurationIndex (uint16_t srcCi)
|
||||
{
|
||||
m_phy->DoSetSrsConfigurationIndex (srsCI);
|
||||
m_phy->DoSetSrsConfigurationIndex (srcCi);
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
@@ -616,7 +616,7 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
if (srs)
|
||||
{
|
||||
Simulator::Schedule (Seconds (0.000928572), // (0.001/14) * 13
|
||||
&LteUePhy::SendSrsChannel, this);
|
||||
&LteUePhy::SendSrs, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
}
|
||||
|
||||
void
|
||||
LteUePhy::SendSrsChannel ()
|
||||
LteUePhy::SendSrs ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this << " UE " << m_rnti << " start tx SRS, cell Id " << m_cellId);
|
||||
// set the current tx power spectral density (full bandwidth)
|
||||
@@ -693,12 +693,12 @@ LteUePhy::DoSetTransmissionMode (uint8_t txMode)
|
||||
}
|
||||
|
||||
void
|
||||
LteUePhy::DoSetSrsConfigurationIndex (uint16_t srsCI)
|
||||
LteUePhy::DoSetSrsConfigurationIndex (uint16_t srcCi)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << srsCI);
|
||||
m_srsPeriodicity = GetSrsPeriodicity (srsCI);
|
||||
m_srsCounter = GetSrsSubframeOffset (srsCI) + 1;
|
||||
NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << GetSrsSubframeOffset (srsCI) << " cellId " << m_cellId << " CI " << srsCI);
|
||||
NS_LOG_FUNCTION (this << srcCi);
|
||||
m_srsPeriodicity = GetSrsPeriodicity (srcCi);
|
||||
m_srsCounter = GetSrsSubframeOffset (srcCi) + 1;
|
||||
NS_LOG_DEBUG (this << " UE SRS P " << m_srsPeriodicity << " RNTI " << m_rnti << " offset " << GetSrsSubframeOffset (srcCi) << " cellId " << m_cellId << " CI " << srcCi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >);
|
||||
|
||||
virtual void DoSetTransmissionMode (uint8_t txMode);
|
||||
virtual void DoSetSrsConfigurationIndex (uint16_t srsCI);
|
||||
virtual void DoSetSrsConfigurationIndex (uint16_t srcCi);
|
||||
|
||||
|
||||
|
||||
@@ -197,7 +197,10 @@ public:
|
||||
*/
|
||||
void SetEnbCellId (uint16_t cellId);
|
||||
|
||||
void SendSrsChannel ();
|
||||
/**
|
||||
* \brief Send the SRS signal in the last symbols of the frame
|
||||
*/
|
||||
void SendSrs ();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ NS_OBJECT_ENSURE_REGISTERED (LteUeRrc);
|
||||
LteUeRrc::LteUeRrc ()
|
||||
: m_cmacSapProvider (0),
|
||||
m_macSapProvider (0),
|
||||
m_rnti (0),
|
||||
m_cellId (0)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
Reference in New Issue
Block a user