25 #include "dl-mac-messages.h"
26 #include "ns3/address-utils.h"
30 DcdChannelEncodings::DcdChannelEncodings (
void)
37 DcdChannelEncodings::~DcdChannelEncodings (
void)
42 DcdChannelEncodings::SetBsEirp (uint16_t bs_eirp)
48 DcdChannelEncodings::SetEirxPIrMax (uint16_t eir_x_p_ir_max)
50 m_eirXPIrMax = eir_x_p_ir_max;
54 DcdChannelEncodings::SetFrequency (uint32_t frequency)
56 m_frequency = frequency;
60 DcdChannelEncodings::GetBsEirp (
void)
const
66 DcdChannelEncodings::GetEirxPIrMax (
void)
const
72 DcdChannelEncodings::GetFrequency (
void)
const
78 DcdChannelEncodings::GetSize (
void)
const
84 DcdChannelEncodings::Write (Buffer::Iterator start)
const
86 Buffer::Iterator i = start;
87 i.WriteU16 (m_bsEirp);
88 i.WriteU16 (m_eirXPIrMax);
89 i.WriteU32 (m_frequency);
94 DcdChannelEncodings::Read (Buffer::Iterator start)
96 Buffer::Iterator i = start;
97 m_bsEirp = i.ReadU16 ();
98 m_eirXPIrMax = i.ReadU16 ();
99 m_frequency = i.ReadU32 ();
110 m_frameDurationCode (0),
115 OfdmDcdChannelEncodings::~OfdmDcdChannelEncodings (
void)
120 OfdmDcdChannelEncodings::SetChannelNr (uint8_t channelNr)
122 m_channelNr = channelNr;
126 OfdmDcdChannelEncodings::SetTtg (uint8_t ttg)
132 OfdmDcdChannelEncodings::SetRtg (uint8_t rtg)
138 OfdmDcdChannelEncodings::SetBaseStationId (Mac48Address baseStationId)
140 m_baseStationId = baseStationId;
144 OfdmDcdChannelEncodings::SetFrameDurationCode (uint8_t frameDurationCode)
146 m_frameDurationCode = frameDurationCode;
150 OfdmDcdChannelEncodings::SetFrameNumber (uint32_t frameNumber)
152 m_frameNumber = frameNumber;
156 OfdmDcdChannelEncodings::GetChannelNr (
void)
const
162 OfdmDcdChannelEncodings::GetTtg (
void)
const
168 OfdmDcdChannelEncodings::GetRtg (
void)
const
174 OfdmDcdChannelEncodings::GetBaseStationId (
void)
const
176 return m_baseStationId;
180 OfdmDcdChannelEncodings::GetFrameDurationCode (
void)
const
182 return m_frameDurationCode;
186 OfdmDcdChannelEncodings::GetFrameNumber (
void)
const
188 return m_frameNumber;
192 OfdmDcdChannelEncodings::GetSize (
void)
const
194 return DcdChannelEncodings::GetSize () + 1 + 1 + 1 + 6 + 1 + 4;
198 OfdmDcdChannelEncodings::DoWrite (Buffer::Iterator start)
const
200 Buffer::Iterator i = start;
201 i.WriteU8 (m_channelNr);
204 WriteTo (i, m_baseStationId);
205 i.WriteU8 (m_frameDurationCode);
206 i.WriteU32 (m_frameNumber);
211 OfdmDcdChannelEncodings::DoRead (Buffer::Iterator start)
213 Buffer::Iterator i = start;
214 m_channelNr = i.ReadU8 ();
217 ReadFrom (i, m_baseStationId);
218 m_frameDurationCode = i.ReadU8 ();
219 m_frameNumber = i.ReadU32 ();
225 OfdmDlBurstProfile::OfdmDlBurstProfile (
void)
233 OfdmDlBurstProfile::~OfdmDlBurstProfile (
void)
238 OfdmDlBurstProfile::SetType (uint8_t type)
244 OfdmDlBurstProfile::SetLength (uint8_t length)
250 OfdmDlBurstProfile::SetDiuc (uint8_t diuc)
256 OfdmDlBurstProfile::SetFecCodeType (uint8_t fecCodeType)
258 m_fecCodeType = fecCodeType;
262 OfdmDlBurstProfile::GetType (
void)
const
268 OfdmDlBurstProfile::GetLength (
void)
const
274 OfdmDlBurstProfile::GetDiuc (
void)
const
280 OfdmDlBurstProfile::GetFecCodeType (
void)
const
282 return m_fecCodeType;
286 OfdmDlBurstProfile::GetSize (
void)
const
288 return 1 + 1 + 1 + 1;
292 OfdmDlBurstProfile::Write (Buffer::Iterator start)
const
294 Buffer::Iterator i = start;
296 i.WriteU8 (m_length);
298 i.WriteU8 (m_fecCodeType);
303 OfdmDlBurstProfile::Read (Buffer::Iterator start)
305 Buffer::Iterator i = start;
306 m_type = i.ReadU8 ();
307 m_length = i.ReadU8 ();
308 m_diuc = i.ReadU8 ();
309 m_fecCodeType = i.ReadU8 ();
315 NS_OBJECT_ENSURE_REGISTERED (Dcd);
319 m_configurationChangeCount (0),
320 m_nrDlBurstProfiles (0)
329 Dcd::SetConfigurationChangeCount (uint8_t configurationChangeCount)
331 m_configurationChangeCount = configurationChangeCount;
335 Dcd::SetChannelEncodings (OfdmDcdChannelEncodings channelEncodings)
337 m_channelEncodings = channelEncodings;
341 Dcd::SetNrDlBurstProfiles (uint8_t nrDlBurstProfiles)
343 m_nrDlBurstProfiles = nrDlBurstProfiles;
347 Dcd::AddDlBurstProfile (OfdmDlBurstProfile dlBurstProfile)
349 m_dlBurstProfiles.push_back (dlBurstProfile);
353 Dcd::GetConfigurationChangeCount (
void)
const
355 return m_configurationChangeCount;
358 OfdmDcdChannelEncodings
359 Dcd::GetChannelEncodings (
void)
const
361 return m_channelEncodings;
364 std::vector<OfdmDlBurstProfile>
365 Dcd::GetDlBurstProfiles (
void)
const
367 return m_dlBurstProfiles;
371 Dcd::GetNrDlBurstProfiles (
void)
const
373 return m_nrDlBurstProfiles;
377 Dcd::GetName (
void)
const
383 Dcd::GetTypeId (
void)
385 static TypeId tid = TypeId (
"ns3::Dcd")
386 .SetParent<Header> ()
387 .AddConstructor<Dcd> ()
401 os <<
" configuration change count = "
402 << (uint32_t) m_configurationChangeCount
403 <<
", number of dl burst profiles = " << m_dlBurstProfiles.size ();
409 uint32_t dlBurstProfilesSize = 0;
411 for (std::vector<OfdmDlBurstProfile>::const_iterator iter =
412 m_dlBurstProfiles.begin (); iter != m_dlBurstProfiles.end (); ++iter)
415 dlBurstProfilesSize += burstProfile.GetSize ();
418 return 1 + 1 + m_channelEncodings.GetSize () + dlBurstProfilesSize;
426 i.
WriteU8 (m_configurationChangeCount);
427 i = m_channelEncodings.Write (i);
429 for (std::vector<OfdmDlBurstProfile>::const_iterator iter =
430 m_dlBurstProfiles.begin (); iter != m_dlBurstProfiles.end (); ++iter)
433 i = burstProfile.Write (i);
442 m_configurationChangeCount = i.
ReadU8 ();
443 i = m_channelEncodings.Read (i);
445 for (uint8_t j = 0; j < m_nrDlBurstProfiles; j++)
448 i = burstProfile.Read (i);
449 AddDlBurstProfile (burstProfile);
460 m_preamblePresent (0),
465 OfdmDlMapIe::~OfdmDlMapIe (
void)
470 OfdmDlMapIe::SetCid (Cid cid)
476 OfdmDlMapIe::SetDiuc (uint8_t diuc)
482 OfdmDlMapIe::SetPreamblePresent (uint8_t preamblePresent)
484 m_preamblePresent = preamblePresent;
488 OfdmDlMapIe::SetStartTime (uint16_t startTime)
490 m_startTime = startTime;
494 OfdmDlMapIe::GetCid (
void)
const
500 OfdmDlMapIe::GetDiuc (
void)
const
506 OfdmDlMapIe::GetPreamblePresent (
void)
const
508 return m_preamblePresent;
512 OfdmDlMapIe::GetStartTime (
void)
const
518 OfdmDlMapIe::GetSize (
void)
const
520 return 2 + 1 + 1 + 2;
524 OfdmDlMapIe::Write (Buffer::Iterator start)
const
526 Buffer::Iterator i = start;
529 i.WriteU8 (m_preamblePresent);
530 i.WriteU16 (m_startTime);
535 OfdmDlMapIe::Read (Buffer::Iterator start)
537 Buffer::Iterator i = start;
538 m_cid = i.ReadU16 ();
539 m_diuc = i.ReadU8 ();
540 m_preamblePresent = i.ReadU8 ();
541 m_startTime = i.ReadU16 ();
547 NS_OBJECT_ENSURE_REGISTERED (DlMap);
560 DlMap::SetDcdCount (uint8_t dcdCount)
562 m_dcdCount = dcdCount;
566 DlMap::SetBaseStationId (Mac48Address baseStationId)
568 m_baseStationId = baseStationId;
572 DlMap::AddDlMapElement (OfdmDlMapIe dlMapElement)
574 m_dlMapElements.push_back (dlMapElement);
578 DlMap::GetDcdCount (
void)
const
584 DlMap::GetBaseStationId (
void)
const
586 return m_baseStationId;
589 std::list<OfdmDlMapIe>
590 DlMap::GetDlMapElements (
void)
const
592 return m_dlMapElements;
596 DlMap::GetName (
void)
const
602 DlMap::GetTypeId (
void)
604 static TypeId tid = TypeId (
"ns3::DlMap")
605 .SetParent<Header> ()
606 .AddConstructor<DlMap> ()
620 os <<
" dcd count = " << (uint32_t) m_dcdCount <<
", base station id = "
621 << m_baseStationId <<
", number of dl-map elements = "
622 << m_dlMapElements.size ();
628 uint32_t dlMapElementsSize = 0;
630 for (std::list<OfdmDlMapIe>::const_iterator iter = m_dlMapElements.begin (); iter
631 != m_dlMapElements.end (); ++iter)
634 dlMapElementsSize += dlMapIe.GetSize ();
637 return 1 + 6 + dlMapElementsSize;
645 WriteTo (i, m_baseStationId);
647 for (std::list<OfdmDlMapIe>::const_iterator iter = m_dlMapElements.begin (); iter
648 != m_dlMapElements.end (); ++iter)
651 i = dlMapIe.Write (i);
660 ReadFrom (i, m_baseStationId);
662 m_dlMapElements.clear ();
667 i = dlMapIe.Read (i);
669 AddDlMapElement (dlMapIe);
671 if (dlMapIe.GetDiuc () == 14)
void Serialize(Buffer::Iterator start) const
virtual TypeId GetInstanceTypeId(void) const
OfdmDcdChannelEncodings(void)
This class implements the DCD channel encodings as described by "IEEE Standard for Local and metropol...
uint32_t GetDistanceFrom(Iterator const &o) const
iterator in a Buffer instance
uint32_t GetSerializedSize(void) const
void Print(std::ostream &os) const
uint32_t GetSerializedSize(void) const
uint32_t Deserialize(Buffer::Iterator start)
DlMap(void)
This class implements DL-map ie as described by "IEEE Standard for Local and metropolitan area networ...
OfdmDlMapIe(void)
This class implements DL-map ie as described by "IEEE Standard for Local and metropolitan area networ...
uint32_t Deserialize(Buffer::Iterator start)
void Print(std::ostream &os) const
void WriteU8(uint8_t data)
virtual TypeId GetInstanceTypeId(void) const
uint16_t GetIdentifier(void) const
Dcd(void)
This class implements Downlink channel descriptor as described by "IEEE Standard for Local and metrop...
void Serialize(Buffer::Iterator start) const