22 #include "burst-profile-manager.h"
23 #include "bs-net-device.h"
24 #include "ss-net-device.h"
25 #include "ss-record.h"
26 #include "ss-manager.h"
28 #include "mac-messages.h"
34 NS_OBJECT_ENSURE_REGISTERED (BurstProfileManager);
36 TypeId BurstProfileManager::GetTypeId (
void)
38 static TypeId tid = TypeId (
"ns3::BurstProfileManager")
39 .SetParent<Object> ();
43 BurstProfileManager::BurstProfileManager (Ptr<WimaxNetDevice> device)
48 BurstProfileManager::~BurstProfileManager (
void)
60 uint16_t BurstProfileManager::GetNrBurstProfilesToDefine (
void)
68 WimaxPhy::ModulationType
69 BurstProfileManager::GetModulationType (uint8_t iuc,
70 WimaxNetDevice::Direction direction)
const
72 if (direction == WimaxNetDevice::DIRECTION_DOWNLINK)
74 std::vector<OfdmDlBurstProfile> dlBurstProfiles =
75 m_device->GetCurrentDcd ().GetDlBurstProfiles ();
76 for (std::vector<OfdmDlBurstProfile>::iterator iter =
77 dlBurstProfiles.begin (); iter != dlBurstProfiles.end (); ++iter)
79 if (iter->GetDiuc () == iuc)
81 return (WimaxPhy::ModulationType) iter->GetFecCodeType ();
87 std::vector<OfdmUlBurstProfile> ulBurstProfiles =
88 m_device->GetCurrentUcd ().GetUlBurstProfiles ();
89 for (std::vector<OfdmUlBurstProfile>::iterator iter =
90 ulBurstProfiles.begin (); iter != ulBurstProfiles.end (); ++iter)
92 if (iter->GetUiuc () == iuc)
94 return (WimaxPhy::ModulationType) iter->GetFecCodeType ();
102 return (WimaxPhy::ModulationType) -1;
106 BurstProfileManager::GetBurstProfile (
107 WimaxPhy::ModulationType modulationType,
108 WimaxNetDevice::Direction direction)
const
110 if (direction == WimaxNetDevice::DIRECTION_DOWNLINK)
112 std::vector<OfdmDlBurstProfile> dlBurstProfiles =
113 m_device->GetCurrentDcd ().GetDlBurstProfiles ();
114 for (std::vector<OfdmDlBurstProfile>::iterator iter =
115 dlBurstProfiles.begin (); iter != dlBurstProfiles.end (); ++iter)
117 if (iter->GetFecCodeType () == modulationType)
119 return iter->GetDiuc ();
125 std::vector<OfdmUlBurstProfile> ulBurstProfiles =
126 m_device->GetCurrentUcd ().GetUlBurstProfiles ();
127 for (std::vector<OfdmUlBurstProfile>::iterator iter =
128 ulBurstProfiles.begin (); iter != ulBurstProfiles.end (); ++iter)
130 if (iter->GetFecCodeType () == modulationType)
132 return iter->GetUiuc ();
144 BurstProfileManager::GetBurstProfileForSS (
const SSRecord *ssRecord,
145 const RngReq *rngreq, WimaxPhy::ModulationType &modulationType)
151 modulationType = GetModulationTypeForSS (ssRecord, rngreq);
152 return GetBurstProfile (modulationType, WimaxNetDevice::DIRECTION_DOWNLINK);
155 WimaxPhy::ModulationType
156 BurstProfileManager::GetModulationTypeForSS (
const SSRecord *ssRecord,
const RngReq *rngreq)
159 return GetModulationType (rngreq->GetReqDlBurstProfile (),
160 WimaxNetDevice::DIRECTION_DOWNLINK);
164 BurstProfileManager::GetBurstProfileToRequest (
void)
169 return GetBurstProfile (
170 m_device->GetObject<SubscriberStationNetDevice> ()->GetModulationType (),
171 WimaxNetDevice::DIRECTION_DOWNLINK);
#define NS_LOG_COMPONENT_DEFINE(name)
#define NS_FATAL_ERROR(msg)
fatal error handling