24 #include <ns3/object-factory.h>
27 #include <ns3/simulator.h>
28 #include <ns3/trace-source-accessor.h>
29 #include <ns3/antenna-model.h>
36 #include <ns3/lte-mi-error-model.h>
37 #include <ns3/lte-radio-bearer-tag.h>
38 #include <ns3/boolean.h>
39 #include <ns3/double.h>
72 m_transmissionMode (0)
75 m_random = CreateObject<UniformRandomVariable> ();
79 for (uint8_t i = 0; i < 7; i++)
133 .AddTraceSource (
"TxStart",
134 "Trace fired when a new transmission is started",
136 .AddTraceSource (
"TxEnd",
137 "Trace fired when a previosuly started transmission is finished",
139 .AddTraceSource (
"RxStart",
140 "Trace fired when the start of a signal is detected",
142 .AddTraceSource (
"RxEndOk",
143 "Trace fired when a previosuly started RX terminates successfully",
145 .AddTraceSource (
"RxEndError",
146 "Trace fired when a previosuly started RX terminates with an error",
148 .AddAttribute (
"PemEnabled",
149 "Activate/Deactivate the error model (by default is active).",
152 MakeBooleanChecker ())
287 NS_FATAL_ERROR (
"cannot TX while RX: according to FDD channel acces, the physical layer for transmission cannot be used for reception");
291 NS_FATAL_ERROR (
"cannot TX while already TX: the MAC should avoid this");
317 txParams->duration =
Seconds (tti);
318 txParams->txPhy = GetObject<SpectrumPhy> ();
321 txParams->packetBurst = pb;
369 Time duration = spectrumRxParams->duration;
376 if (lteRxParams != 0)
381 NS_FATAL_ERROR (
"cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception");
392 NS_ASSERT (lteRxParams->packetBurst->Begin () != lteRxParams->packetBurst->End ());
394 Ptr<Packet> firstPacketInBurst = *(lteRxParams->packetBurst->Begin ());
398 NS_LOG_LOGIC (
this <<
" synchronized with this signal (cellId=" << tag.GetCellId () <<
")");
406 NS_LOG_LOGIC (
this <<
" scheduling EndRx with delay " << duration);
431 NS_LOG_LOGIC (
this <<
" not in sync with this signal (cellId="
432 << tag.GetCellId () <<
", m_cellId=" <<
m_cellId <<
")");
457 NS_LOG_LOGIC (
this <<
" rnti: " << rnti <<
" size " << size <<
" mcs " << (uint16_t)mcs <<
" layer " << (uint8_t)layer);
461 expectedTbs_t::iterator it;
469 tbInfo_t tbInfo = {size, mcs, map,
false};
470 m_expectedTbs.insert (std::pair<TbId_t, tbInfo_t> (tbId,tbInfo ));
498 double errorRate =
LteMiErrorModel::GetTbError (m_sinrPerceived, (*itTb).second.rbBitmap, (*itTb).second.size, (*itTb).second.mcs);
500 NS_LOG_DEBUG (
this <<
"RNTI " << (*itTb).first.m_rnti <<
" size " << (*itTb).second.size <<
" mcs " << (uint32_t)(*itTb).second.mcs <<
" bitmap " << (*itTb).second.rbBitmap.size () <<
" layer " << (uint16_t)(*itTb).first.m_layer <<
" ErrorRate " << errorRate <<
" corrupted " << (*itTb).second.corrupt);
517 (*j)->PeekPacketTag (tag);
525 if (!(*itTb).second.corrupt)
571 NS_LOG_FUNCTION (
this <<
" txmode " << (uint16_t)txMode <<
" gain " << gain);
573 gain = pow (10.0, (gain / 10.0));
578 std::vector <double> temp;
581 for (uint8_t i = 0; i < temp.size (); i++)