LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari | 3 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 LteEnbPhy::GetTxPower () const | 327 LteEnbPhy::GetTxPower () const |
328 { | 328 { |
329 NS_LOG_FUNCTION (this); | 329 NS_LOG_FUNCTION (this); |
330 return m_txPower; | 330 return m_txPower; |
331 } | 331 } |
332 | 332 |
333 int8_t | 333 int8_t |
334 LteEnbPhy::DoGetReferenceSignalPower () const | 334 LteEnbPhy::DoGetReferenceSignalPower () const |
335 { | 335 { |
336 NS_LOG_FUNCTION (this); | 336 NS_LOG_FUNCTION (this); |
337 return (int8_t)m_txPower; | 337 return static_cast<int8_t>(m_txPower); |
338 } | 338 } |
339 | 339 |
340 void | 340 void |
341 LteEnbPhy::SetNoiseFigure (double nf) | 341 LteEnbPhy::SetNoiseFigure (double nf) |
342 { | 342 { |
343 NS_LOG_FUNCTION (this << nf); | 343 NS_LOG_FUNCTION (this << nf); |
344 m_noiseFigure = nf; | 344 m_noiseFigure = nf; |
345 } | 345 } |
346 | 346 |
347 double | 347 double |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 void | 595 void |
596 LteEnbPhy::StartFrame (void) | 596 LteEnbPhy::StartFrame (void) |
597 { | 597 { |
598 NS_LOG_FUNCTION (this); | 598 NS_LOG_FUNCTION (this); |
599 | 599 |
600 ++m_nrFrames; | 600 ++m_nrFrames; |
601 NS_LOG_INFO ("-----frame " << m_nrFrames << "-----"); | 601 NS_LOG_INFO ("-----frame " << m_nrFrames << "-----"); |
602 m_nrSubFrames = 0; | 602 m_nrSubFrames = 0; |
603 | 603 |
604 // send MIB at beginning of every frame | 604 // send MIB at beginning of every frame |
605 m_mib.systemFrameNumber = (uint8_t)m_nrSubFrames; | 605 m_mib.systemFrameNumber = static_cast<uint8_t> (m_nrSubFrames); |
606 Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> (); | 606 Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> (); |
607 mibMsg->SetMib (m_mib); | 607 mibMsg->SetMib (m_mib); |
608 m_controlMessagesQueue.at (0).push_back (mibMsg); | 608 m_controlMessagesQueue.at (0).push_back (mibMsg); |
609 | 609 |
610 StartSubFrame (); | 610 StartSubFrame (); |
611 } | 611 } |
612 | 612 |
613 | 613 |
614 void | 614 void |
615 LteEnbPhy::StartSubFrame (void) | 615 LteEnbPhy::StartSubFrame (void) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 675 } |
676 } | 676 } |
677 } | 677 } |
678 | 678 |
679 // process the current burst of control messages | 679 // process the current burst of control messages |
680 std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages (); | 680 std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages (); |
681 m_dlDataRbMap.clear (); | 681 m_dlDataRbMap.clear (); |
682 m_dlPowerAllocationMap.clear (); | 682 m_dlPowerAllocationMap.clear (); |
683 if (ctrlMsg.size () > 0) | 683 if (ctrlMsg.size () > 0) |
684 { | 684 { |
685 std::list<Ptr<LteControlMessage> >::iterator it; | 685 std::list<Ptr<LteControlMessage> >::iterator it = ctrlMsg.begin (); |
686 it = ctrlMsg.begin (); | |
687 while (it != ctrlMsg.end ()) | 686 while (it != ctrlMsg.end ()) |
688 { | 687 { |
689 Ptr<LteControlMessage> msg = (*it); | 688 Ptr<LteControlMessage> msg = (*it); |
690 if (msg->GetMessageType () == LteControlMessage::DL_DCI) | 689 if (msg->GetMessageType () == LteControlMessage::DL_DCI) |
691 { | 690 { |
692 Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessa
ge> (msg); | 691 Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessa
ge> (msg); |
693 // get the tx power spectral density according to DL-DCI(s) | 692 // get the tx power spectral density according to DL-DCI(s) |
694 // translate the DCI to Spectrum framework | 693 // translate the DCI to Spectrum framework |
695 uint32_t mask = 0x1; | 694 uint32_t mask = 0x1; |
696 for (int i = 0; i < 32; i++) | 695 for (int i = 0; i < 32; i++) |
(...skipping 29 matching lines...) Expand all Loading... |
726 | 725 |
727 } | 726 } |
728 else if (msg->GetMessageType () == LteControlMessage::UL_DCI) | 727 else if (msg->GetMessageType () == LteControlMessage::UL_DCI) |
729 { | 728 { |
730 Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessa
ge> (msg); | 729 Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessa
ge> (msg); |
731 QueueUlDci (*dci); | 730 QueueUlDci (*dci); |
732 } | 731 } |
733 else if (msg->GetMessageType () == LteControlMessage::RAR) | 732 else if (msg->GetMessageType () == LteControlMessage::RAR) |
734 { | 733 { |
735 Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessag
e> (msg); | 734 Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessag
e> (msg); |
736 for (std::list<RarLteControlMessage::Rar>::const_iterator it1 = ra
rMsg->RarListBegin (); it1 != rarMsg->RarListEnd (); ++it1) | 735 for (std::list<RarLteControlMessage::Rar>::const_iterator rit = ra
rMsg->RarListBegin (); rit != rarMsg->RarListEnd (); ++rit) |
737 { | 736 { |
738 if (it1->rarPayload.m_grant.m_ulDelay == true) | 737 if (rit->rarPayload.m_grant.m_ulDelay == true) |
739 { | 738 { |
740 NS_FATAL_ERROR (" RAR delay is not yet implemented"); | 739 NS_FATAL_ERROR (" RAR delay is not yet implemented"); |
741 } | 740 } |
742 UlGrant_s ulGrant = it1->rarPayload.m_grant; | 741 UlGrant_s ulGrant = rit->rarPayload.m_grant; |
743 // translate the UL grant in a standard UL-DCI and queue it | 742 // translate the UL grant in a standard UL-DCI and queue it |
744 UlDciListElement_s dci; | 743 UlDciListElement_s dci; |
745 dci.m_rnti = ulGrant.m_rnti; | 744 dci.m_rnti = ulGrant.m_rnti; |
746 dci.m_rbStart = ulGrant.m_rbStart; | 745 dci.m_rbStart = ulGrant.m_rbStart; |
747 dci.m_rbLen = ulGrant.m_rbLen; | 746 dci.m_rbLen = ulGrant.m_rbLen; |
748 dci.m_tbSize = ulGrant.m_tbSize; | 747 dci.m_tbSize = ulGrant.m_tbSize; |
749 dci.m_mcs = ulGrant.m_mcs; | 748 dci.m_mcs = ulGrant.m_mcs; |
750 dci.m_hopping = ulGrant.m_hopping; | 749 dci.m_hopping = ulGrant.m_hopping; |
751 dci.m_tpc = ulGrant.m_tpc; | 750 dci.m_tpc = ulGrant.m_tpc; |
752 dci.m_cqiRequest = ulGrant.m_cqiRequest; | 751 dci.m_cqiRequest = ulGrant.m_cqiRequest; |
753 dci.m_ndi = 1; | 752 dci.m_ndi = 1; |
754 UlDciLteControlMessage msg1; | 753 UlDciLteControlMessage ulmsg; |
755 msg1.SetDci (dci); | 754 ulmsg.SetDci (dci); |
756 QueueUlDci (msg1); | 755 QueueUlDci (ulmsg); |
757 } | 756 } |
758 } | 757 } |
759 it++; | 758 it++; |
760 | 759 |
761 } | 760 } |
762 } | 761 } |
763 | 762 |
764 SendControlChannels (ctrlMsg); | 763 SendControlChannels (ctrlMsg); |
765 | 764 |
766 // send data frame | 765 // send data frame |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 if (m_interferenceSampleCounter == m_interferenceSamplePeriod) | 866 if (m_interferenceSampleCounter == m_interferenceSamplePeriod) |
868 { | 867 { |
869 m_reportInterferenceTrace (m_cellId, interfCopy); | 868 m_reportInterferenceTrace (m_cellId, interfCopy); |
870 m_interferenceSampleCounter = 0; | 869 m_interferenceSampleCounter = 0; |
871 } | 870 } |
872 } | 871 } |
873 | 872 |
874 void | 873 void |
875 LteEnbPhy::ReportRsReceivedPower (const SpectrumValue& power) | 874 LteEnbPhy::ReportRsReceivedPower (const SpectrumValue& power) |
876 { | 875 { |
877 NS_UNUSED(power); | 876 NS_UNUSED (power); |
878 // not used by eNB | 877 // not used by eNB |
879 } | 878 } |
880 | 879 |
881 | 880 |
882 | 881 |
883 FfMacSchedSapProvider::SchedUlCqiInfoReqParameters | 882 FfMacSchedSapProvider::SchedUlCqiInfoReqParameters |
884 LteEnbPhy::CreatePuschCqiReport (const SpectrumValue& sinr) | 883 LteEnbPhy::CreatePuschCqiReport (const SpectrumValue& sinr) |
885 { | 884 { |
886 NS_LOG_FUNCTION (this << sinr); | 885 NS_LOG_FUNCTION (this << sinr); |
887 Values::const_iterator it; | 886 Values::const_iterator it; |
(...skipping 24 matching lines...) Expand all Loading... |
912 static const int Type0AllocationRbg[4] = { | 911 static const int Type0AllocationRbg[4] = { |
913 10, // RGB size 1 | 912 10, // RGB size 1 |
914 26, // RGB size 2 | 913 26, // RGB size 2 |
915 63, // RGB size 3 | 914 63, // RGB size 3 |
916 110 // RGB size 4 | 915 110 // RGB size 4 |
917 }; // see table 7.1.6.1-1 of 36.213 | 916 }; // see table 7.1.6.1-1 of 36.213 |
918 for (int i = 0; i < 4; i++) | 917 for (int i = 0; i < 4; i++) |
919 { | 918 { |
920 if (dlBandwidth < Type0AllocationRbg[i]) | 919 if (dlBandwidth < Type0AllocationRbg[i]) |
921 { | 920 { |
922 m_rbgSize = (uint8_t)(i + 1); | 921 m_rbgSize = static_cast<uint8_t> (i + 1); |
923 break; | 922 break; |
924 } | 923 } |
925 } | 924 } |
926 } | 925 } |
927 | 926 |
928 void· | 927 void· |
929 LteEnbPhy::DoSetEarfcn (uint32_t ulEarfcn, uint32_t dlEarfcn) | 928 LteEnbPhy::DoSetEarfcn (uint32_t ulEarfcn, uint32_t dlEarfcn) |
930 { | 929 { |
931 NS_LOG_FUNCTION (this << ulEarfcn << dlEarfcn); | 930 NS_LOG_FUNCTION (this << ulEarfcn << dlEarfcn); |
932 m_ulEarfcn = ulEarfcn; | 931 m_ulEarfcn = ulEarfcn; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 | 1130 |
1132 void | 1131 void |
1133 LteEnbPhy::ReceiveLteUlHarqFeedback (UlInfoListElement_s mes) | 1132 LteEnbPhy::ReceiveLteUlHarqFeedback (UlInfoListElement_s mes) |
1134 { | 1133 { |
1135 NS_LOG_FUNCTION (this); | 1134 NS_LOG_FUNCTION (this); |
1136 // forward to scheduler | 1135 // forward to scheduler |
1137 m_enbPhySapUser->UlInfoListElementHarqFeeback (mes); | 1136 m_enbPhySapUser->UlInfoListElementHarqFeeback (mes); |
1138 } | 1137 } |
1139 | 1138 |
1140 }; | 1139 }; |
LEFT | RIGHT |