24 #include "ul-mac-messages.h"
28 NS_OBJECT_ENSURE_REGISTERED (Ucd);
30 UcdChannelEncodings::UcdChannelEncodings (
void)
37 UcdChannelEncodings::~UcdChannelEncodings (
void)
42 UcdChannelEncodings::SetBwReqOppSize (uint16_t bwReqOppSize)
44 m_bwReqOppSize = bwReqOppSize;
48 UcdChannelEncodings::SetRangReqOppSize (uint16_t rangReqOppSize)
50 m_rangReqOppSize = rangReqOppSize;
54 UcdChannelEncodings::SetFrequency (uint32_t frequency)
56 m_frequency = frequency;
60 UcdChannelEncodings::GetBwReqOppSize (
void)
const
62 return m_bwReqOppSize;
66 UcdChannelEncodings::GetRangReqOppSize (
void)
const
68 return m_rangReqOppSize;
72 UcdChannelEncodings::GetFrequency (
void)
const
78 UcdChannelEncodings::GetSize (
void)
const
84 UcdChannelEncodings::Write (Buffer::Iterator start)
const
86 Buffer::Iterator i = start;
87 i.WriteU16 (m_bwReqOppSize);
88 i.WriteU16 (m_rangReqOppSize);
89 i.WriteU32 (m_frequency);
94 UcdChannelEncodings::Read (Buffer::Iterator start)
96 Buffer::Iterator i = start;
97 m_bwReqOppSize = i.ReadU16 ();
98 m_rangReqOppSize = i.ReadU16 ();
99 m_frequency = i.ReadU32 ();
106 : m_sbchnlReqRegionFullParams (0),
107 m_sbchnlFocContCodes (0)
111 OfdmUcdChannelEncodings::~OfdmUcdChannelEncodings (
void)
116 OfdmUcdChannelEncodings::SetSbchnlReqRegionFullParams (
117 uint8_t sbchnlReqRegionFullParams)
119 m_sbchnlReqRegionFullParams = sbchnlReqRegionFullParams;
123 OfdmUcdChannelEncodings::SetSbchnlFocContCodes (uint8_t sbchnlFocContCodes)
125 m_sbchnlFocContCodes = sbchnlFocContCodes;
129 OfdmUcdChannelEncodings::GetSbchnlReqRegionFullParams (
void)
const
131 return m_sbchnlReqRegionFullParams;
135 OfdmUcdChannelEncodings::GetSbchnlFocContCodes (
void)
const
137 return m_sbchnlFocContCodes;
141 OfdmUcdChannelEncodings::GetSize (
void)
const
143 return UcdChannelEncodings::GetSize () + 1 + 1;
147 OfdmUcdChannelEncodings::DoWrite (Buffer::Iterator start)
const
149 Buffer::Iterator i = start;
150 i.WriteU8 (m_sbchnlReqRegionFullParams);
151 i.WriteU8 (m_sbchnlFocContCodes);
156 OfdmUcdChannelEncodings::DoRead (Buffer::Iterator start)
158 Buffer::Iterator i = start;
159 m_sbchnlReqRegionFullParams = i.ReadU8 ();
160 m_sbchnlFocContCodes = i.ReadU8 ();
166 OfdmUlBurstProfile::OfdmUlBurstProfile (
void)
174 OfdmUlBurstProfile::~OfdmUlBurstProfile (
void)
179 OfdmUlBurstProfile::SetType (uint8_t type)
185 OfdmUlBurstProfile::SetLength (uint8_t length)
191 OfdmUlBurstProfile::SetUiuc (uint8_t uiuc)
197 OfdmUlBurstProfile::SetFecCodeType (uint8_t fecCodeType)
199 m_fecCodeType = fecCodeType;
203 OfdmUlBurstProfile::GetType (
void)
const
209 OfdmUlBurstProfile::GetLength (
void)
const
215 OfdmUlBurstProfile::GetUiuc (
void)
const
221 OfdmUlBurstProfile::GetFecCodeType (
void)
const
223 return m_fecCodeType;
227 OfdmUlBurstProfile::GetSize (
void)
const
229 return 1 + 1 + 1 + 1;
233 OfdmUlBurstProfile::Write (Buffer::Iterator start)
const
235 Buffer::Iterator i = start;
237 i.WriteU8 (m_length);
239 i.WriteU8 (m_fecCodeType);
244 OfdmUlBurstProfile::Read (Buffer::Iterator start)
246 Buffer::Iterator i = start;
247 m_type = i.ReadU8 ();
248 m_length = i.ReadU8 ();
249 m_uiuc = i.ReadU8 ();
250 m_fecCodeType = i.ReadU8 ();
257 : m_configurationChangeCount (0),
258 m_rangingBackoffStart (0),
259 m_rangingBackoffEnd (0),
260 m_requestBackoffStart (0),
261 m_requestBackoffEnd (
263 m_nrUlBurstProfiles (0)
272 Ucd::SetConfigurationChangeCount (uint8_t configurationChangeCount)
274 m_configurationChangeCount = configurationChangeCount;
278 Ucd::SetRangingBackoffStart (uint8_t rangingBackoffStart)
280 m_rangingBackoffStart = rangingBackoffStart;
284 Ucd::SetRangingBackoffEnd (uint8_t rangingBackoffEnd)
286 m_rangingBackoffEnd = rangingBackoffEnd;
290 Ucd::SetRequestBackoffStart (uint8_t requestBackoffStart)
292 m_requestBackoffStart = requestBackoffStart;
296 Ucd::SetRequestBackoffEnd (uint8_t requestBackoffEnd)
298 m_requestBackoffEnd = requestBackoffEnd;
302 Ucd::SetChannelEncodings (OfdmUcdChannelEncodings channelEncodings)
304 m_channelEncodings = channelEncodings;
308 Ucd::AddUlBurstProfile (OfdmUlBurstProfile ulBurstProfile)
310 m_ulBurstProfiles.push_back (ulBurstProfile);
314 Ucd::SetNrUlBurstProfiles (uint8_t nrUlBurstProfiles)
317 m_nrUlBurstProfiles = nrUlBurstProfiles;
321 Ucd::GetConfigurationChangeCount (
void)
const
323 return m_configurationChangeCount;
327 Ucd::GetRangingBackoffStart (
void)
const
329 return m_rangingBackoffStart;
333 Ucd::GetRangingBackoffEnd (
void)
const
335 return m_rangingBackoffEnd;
339 Ucd::GetRequestBackoffStart (
void)
const
341 return m_requestBackoffStart;
345 Ucd::GetRequestBackoffEnd (
void)
const
347 return m_requestBackoffEnd;
350 OfdmUcdChannelEncodings
351 Ucd::GetChannelEncodings (
void)
const
353 return m_channelEncodings;
356 std::vector<OfdmUlBurstProfile>
357 Ucd::GetUlBurstProfiles (
void)
const
359 return m_ulBurstProfiles;
363 Ucd::GetNrUlBurstProfiles (
void)
const
365 return m_nrUlBurstProfiles;
369 Ucd::GetName (
void)
const
375 Ucd::GetTypeId (
void)
377 static TypeId tid = TypeId (
"ns3::Ucd")
378 .SetParent<Header> ()
379 .AddConstructor<Ucd> ()
393 os <<
" configuration change count = "
394 << (uint32_t) m_configurationChangeCount <<
", ranging backoff start = "
395 << (uint32_t) m_rangingBackoffStart <<
", ranging backoff end = "
396 << (uint32_t) m_rangingBackoffEnd <<
", request backoff start = "
397 << (uint32_t) m_requestBackoffStart <<
", request backoff end = "
398 << (uint32_t) m_requestBackoffEnd <<
", number of ul burst profiles = "
399 << m_ulBurstProfiles.size ();
405 uint32_t ulBurstProfilesSize = 0;
407 for (std::vector<OfdmUlBurstProfile>::const_iterator iter =
408 m_ulBurstProfiles.begin (); iter != m_ulBurstProfiles.end (); ++iter)
411 ulBurstProfilesSize += burstProfile.GetSize ();
414 return 5 + m_channelEncodings.GetSize () + ulBurstProfilesSize;
421 i.
WriteU8 (m_configurationChangeCount);
422 i.
WriteU8 (m_rangingBackoffStart);
423 i.
WriteU8 (m_rangingBackoffEnd);
424 i.
WriteU8 (m_requestBackoffStart);
425 i.
WriteU8 (m_requestBackoffEnd);
426 i = m_channelEncodings.Write (i);
428 for (std::vector<OfdmUlBurstProfile>::const_iterator iter =
429 m_ulBurstProfiles.begin (); iter != m_ulBurstProfiles.end (); ++iter)
432 i = burstProfile.Write (i);
440 m_configurationChangeCount = i.
ReadU8 ();
441 m_rangingBackoffStart = i.
ReadU8 ();
442 m_rangingBackoffEnd = i.
ReadU8 ();
443 m_requestBackoffStart = i.
ReadU8 ();
444 m_requestBackoffEnd = i.
ReadU8 ();
445 i = m_channelEncodings.Read (i);
447 for (uint8_t j = 0; j < m_nrUlBurstProfiles; j++)
450 i = burstProfile.Read (i);
451 AddUlBurstProfile (burstProfile);
462 m_subchannelIndex (0),
465 m_midambleRepetitionInterval (0)
469 OfdmUlMapIe::~OfdmUlMapIe (
void)
474 OfdmUlMapIe::SetCid (Cid cid)
480 OfdmUlMapIe::SetStartTime (uint16_t startTime)
482 m_startTime = startTime;
486 OfdmUlMapIe::SetSubchannelIndex (uint8_t subchannelIndex)
488 m_subchannelIndex = subchannelIndex;
492 OfdmUlMapIe::SetUiuc (uint8_t uiuc)
498 OfdmUlMapIe::SetDuration (uint16_t duration)
500 m_duration = duration;
504 OfdmUlMapIe::SetMidambleRepetitionInterval (
505 uint8_t midambleRepetitionInterval)
507 m_midambleRepetitionInterval = midambleRepetitionInterval;
511 OfdmUlMapIe::GetCid (
void)
const
517 OfdmUlMapIe::GetStartTime (
void)
const
523 OfdmUlMapIe::GetSubchannelIndex (
void)
const
525 return m_subchannelIndex;
529 OfdmUlMapIe::GetUiuc (
void)
const
535 OfdmUlMapIe::GetDuration (
void)
const
541 OfdmUlMapIe::GetMidambleRepetitionInterval (
void)
const
543 return m_midambleRepetitionInterval;
547 OfdmUlMapIe::GetSize (
void)
const
549 return 2 + 2 + 1 + 1 + 2 + 1;
553 OfdmUlMapIe::Write (Buffer::Iterator start)
const
555 Buffer::Iterator i = start;
557 i.WriteU16 (m_startTime);
558 i.WriteU8 (m_subchannelIndex);
560 i.WriteU16 (m_duration);
561 i.WriteU8 (m_midambleRepetitionInterval);
566 OfdmUlMapIe::Read (Buffer::Iterator start)
568 Buffer::Iterator i = start;
569 m_cid = i.ReadU16 ();
570 m_startTime = i.ReadU16 ();
571 m_subchannelIndex = i.ReadU8 ();
572 m_uiuc = i.ReadU8 ();
573 m_duration = i.ReadU16 ();
574 m_midambleRepetitionInterval = i.ReadU8 ();
580 NS_OBJECT_ENSURE_REGISTERED (UlMap);
585 m_allocationStartTime (0)
594 UlMap::SetUcdCount (uint8_t ucdCount)
596 m_ucdCount = ucdCount;
600 UlMap::SetAllocationStartTime (uint32_t allocationStartTime)
602 m_allocationStartTime = allocationStartTime;
606 UlMap::AddUlMapElement (OfdmUlMapIe ulMapElement)
608 m_ulMapElements.push_back (ulMapElement);
612 UlMap::GetUcdCount (
void)
const
618 UlMap::GetAllocationStartTime (
void)
const
620 return m_allocationStartTime;
623 std::list<OfdmUlMapIe>
624 UlMap::GetUlMapElements (
void)
const
626 return m_ulMapElements;
630 UlMap::GetName (
void)
const
636 UlMap::GetTypeId (
void)
638 static TypeId tid = TypeId (
"ns3::UlMap")
639 .SetParent<Header> ()
640 .AddConstructor<UlMap> ()
654 os <<
" ucd count = " << (uint32_t) m_ucdCount
655 <<
", allocation start time = " << m_allocationStartTime
656 <<
", number of ul-map elements = " << m_ulMapElements.size ();
662 uint32_t ulMapElementsSize = 0;
663 for (std::list<OfdmUlMapIe>::const_iterator iter = m_ulMapElements.begin (); iter
664 != m_ulMapElements.end (); ++iter)
667 ulMapElementsSize += ulMapIe.GetSize ();
670 return 1 + 1 + 4 + ulMapElementsSize;
681 for (std::list<OfdmUlMapIe>::const_iterator iter = m_ulMapElements.begin (); iter
682 != m_ulMapElements.end (); ++iter)
685 i = ulMapIe.Write (i);
695 m_allocationStartTime = i.
ReadU32 ();
697 m_ulMapElements.clear ();
702 i = ulMapIe.Read (i);
704 AddUlMapElement (ulMapIe);
706 if (ulMapIe.GetUiuc () == 14)
void Serialize(Buffer::Iterator start) const
uint32_t GetSerializedSize(void) const
OfdmUlMapIe(void)
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
uint32_t GetSerializedSize(void) const
UlMap(void)
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
uint32_t GetDistanceFrom(Iterator const &o) const
iterator in a Buffer instance
OfdmUcdChannelEncodings(void)
This class implements the UCD channel encodings as described by "IEEE Standard for Local and metropol...
uint32_t Deserialize(Buffer::Iterator start)
void Print(std::ostream &os) const
virtual TypeId GetInstanceTypeId(void) const
void WriteU8(uint8_t data)
uint16_t GetIdentifier(void) const
uint32_t Deserialize(Buffer::Iterator start)
void Serialize(Buffer::Iterator start) const
void Print(std::ostream &os) const
void WriteU32(uint32_t data)
Ucd(void)
This class implements the UCD message as described by "IEEE Standard for Local and metropolitan area ...
virtual TypeId GetInstanceTypeId(void) const