added method LteSpectrumPhy::Reset ()

This commit is contained in:
Nicola Baldo
2012-12-18 16:13:03 +01:00
parent 12b19fe028
commit 758c0a6786
3 changed files with 36 additions and 7 deletions

View File

@@ -294,6 +294,21 @@ LteSpectrumPhy::SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd)
m_interferenceCtrl->SetNoisePowerSpectralDensity (noisePsd);
}
void
LteSpectrumPhy::Reset ()
{
NS_LOG_FUNCTION (this);
m_cellId = 0;
m_state = IDLE;
m_transmissionMode = 0;
m_layersNum = 1;
m_endTxEvent.Cancel ();
m_endRxDataEvent.Cancel ();
m_endRxDlCtrlEvent.Cancel ();
m_endRxUlSrsEvent.Cancel ();
}
void
@@ -429,7 +444,7 @@ LteSpectrumPhy::StartTxDataFrame (Ptr<PacketBurst> pb, std::list<Ptr<LteControlM
txParams->ctrlMsgList = ctrlMsgList;
txParams->cellId = m_cellId;
m_channel->StartTx (txParams);
Simulator::Schedule (duration, &LteSpectrumPhy::EndTx, this);
m_endTxEvent = Simulator::Schedule (duration, &LteSpectrumPhy::EndTx, this);
}
return false;
break;
@@ -484,7 +499,7 @@ LteSpectrumPhy::StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgLi
txParams->cellId = m_cellId;
txParams->ctrlMsgList = ctrlMsgList;
m_channel->StartTx (txParams);
Simulator::Schedule (DL_CTRL_DURATION, &LteSpectrumPhy::EndTx, this);
m_endTxEvent = Simulator::Schedule (DL_CTRL_DURATION, &LteSpectrumPhy::EndTx, this);
}
return false;
break;
@@ -539,7 +554,7 @@ LteSpectrumPhy::StartTxUlSrsFrame ()
txParams->psd = m_txPsd;
txParams->cellId = m_cellId;
m_channel->StartTx (txParams);
Simulator::Schedule (UL_SRS_DURATION, &LteSpectrumPhy::EndTx, this);
m_endTxEvent = Simulator::Schedule (UL_SRS_DURATION, &LteSpectrumPhy::EndTx, this);
}
return false;
break;
@@ -646,7 +661,7 @@ LteSpectrumPhy::StartRxData (Ptr<LteSpectrumSignalParametersDataFrame> params)
m_firstRxStart = Simulator::Now ();
m_firstRxDuration = params->duration;
NS_LOG_LOGIC (this << " scheduling EndRx with delay " << params->duration.GetSeconds () << "s");
Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxData, this);
m_endRxDataEvent = Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxData, this);
}
else
{
@@ -740,11 +755,11 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
{
// store the DCIs
m_rxControlMessageList = lteDlCtrlRxParams->ctrlMsgList;
Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxDlCtrl, this);
m_endRxDlCtrlEvent = Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxDlCtrl, this);
}
else
{
Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxUlSrs, this);
m_endRxUlSrsEvent = Simulator::Schedule (params->duration, &LteSpectrumPhy::EndRxUlSrs, this);
}
}
else if (m_state == RX_CTRL)

View File

@@ -188,6 +188,12 @@ public:
* (Watt, Pascal...) per Hz.
*/
void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
/**
* reset the internal state
*
*/
void Reset ();
/**
* set the AntennaModel to be used
@@ -460,6 +466,12 @@ private:
*/
TracedCallback<PhyReceptionStatParameters> m_ulPhyReception;
EventId m_endTxEvent;
EventId m_endRxDataEvent;
EventId m_endRxDlCtrlEvent;
EventId m_endRxUlSrsEvent;
};

View File

@@ -755,7 +755,7 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
// send packets in queue
NS_LOG_LOGIC (this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti);
NS_LOG_LOGIC (this << " UE - start slot for PUSCH + PUCCH - RNTI " << m_rnti << " CELLID " << m_cellId);
// send the current burts of packets
Ptr<PacketBurst> pb = GetPacketBurst ();
if (pb)
@@ -841,6 +841,8 @@ LteUePhy::DoReset ()
m_subChannelsForTransmissionQueue.resize (m_macChTtiDelay, ulRb);
m_sendSrsEvent.Cancel ();
m_downlinkSpectrumPhy->Reset ();
m_uplinkSpectrumPhy->Reset ();
}
void