24#include "ns3/nstime.h"
25#include "ns3/object.h"
27NS_LOG_COMPONENT_DEFINE(
"SatSuperframeSeq");
38 NS_LOG_FUNCTION(
this);
43 NS_LOG_FUNCTION(
this);
49 static TypeId tid = TypeId(
"ns3::SatSuperframeSeq")
51 .AddConstructor<SatSuperframeSeq>()
52 .AddAttribute(
"TargetDuration",
53 "Target duration time.",
54 TimeValue(MilliSeconds(100)),
64 NS_LOG_FUNCTION(
this);
71 NS_LOG_FUNCTION(
this);
78 NS_LOG_FUNCTION(
this);
86 NS_LOG_FUNCTION(
this);
88 uint32_t carrierCount = 0;
101 NS_LOG_FUNCTION(
this << (uint32_t)seqId);
105 NS_FATAL_ERROR(
"SatSuperframeSeq::GetCarrierCount - unsupported sequence id: " << seqId);
114 NS_LOG_FUNCTION(
this << (uint32_t)seqId);
118 NS_FATAL_ERROR(
"SatSuperframeSeq::GetDuration - unsupported sequence id: " << seqId);
124Ptr<SatSuperframeConf>
127 NS_LOG_FUNCTION(
this << (uint32_t)seqId);
131 NS_FATAL_ERROR(
"SatSuperframeSeq::GetSuperframeConf - unsupported sequence id: " << seqId);
140 NS_LOG_FUNCTION(
this << superframeId << frameId << frameCarrierId);
145 "SatSuperframeSeq::GetCarrierCount - unsupported sequence id: " << superframeId);
148 uint32_t carrierId =
m_superframe[superframeId]->GetCarrierId(frameId, frameCarrierId);
150 for (uint8_t i = 0; i < superframeId; i++)
161 NS_LOG_FUNCTION(
this << carrierId);
163 double superFrameStartFrequency = 0.0;
164 uint32_t currentSuperframe = 0;
165 uint32_t lastIdInSuperframe =
m_superframe[0]->GetCarrierCount() - 1;
166 uint32_t carrierIdInSuperframe = carrierId;
168 while (carrierId > lastIdInSuperframe)
170 carrierIdInSuperframe -=
m_superframe[currentSuperframe]->GetCarrierCount();
171 superFrameStartFrequency +=
m_superframe[currentSuperframe]->GetBandwidthHz();
173 lastIdInSuperframe +=
m_superframe[currentSuperframe]->GetCarrierCount();
176 double carrierFrequencyInSuperframe =
177 m_superframe[currentSuperframe]->GetCarrierFrequencyHz(carrierIdInSuperframe);
179 return superFrameStartFrequency + carrierFrequencyInSuperframe;
186 NS_LOG_FUNCTION(
this << carrierId);
188 uint32_t currentSuperframe = 0;
189 uint32_t lastIdInSuperframe =
m_superframe[0]->GetCarrierCount() - 1;
190 uint32_t carrierIdInSuperframe = carrierId;
192 while (carrierId > lastIdInSuperframe)
194 carrierIdInSuperframe -=
m_superframe[currentSuperframe]->GetCarrierCount();
196 lastIdInSuperframe +=
m_superframe[currentSuperframe]->GetCarrierCount();
199 return m_superframe[currentSuperframe]->GetCarrierBandwidthHz(carrierIdInSuperframe,
CarrierBandwidthType_t
Types of bandwidth.
This class implements super frame sequence.
~SatSuperframeSeq()
Destructor for SatSuperframeSeq.
Ptr< SatSuperframeConf > GetSuperframeConf(uint8_t seqId) const
Get superframe conf of the sequence.
double GetCarrierFrequencyHz(uint32_t carrierId) const
Get the center frequency of the requested carrier.
SatSuperframeSeq()
Default constructor for SatSuperframeConf.
static TypeId GetTypeId(void)
Get the type ID.
void AddSuperframe(Ptr< SatSuperframeConf > conf)
Add super frame (configuration) to super frame sequence.
uint32_t GetCarrierId(uint8_t superframeId, uint8_t frameId, uint16_t frameCarrierId) const
Get global carrier id.
void AddWaveformConf(Ptr< SatWaveformConf > wfConf)
Add waveform configuration class instance to this superframe sequence.
Ptr< SatWaveformConf > GetWaveformConf() const
Get waveform configuration.
SatSuperframeConfList m_superframe
Super frame sequences.
Time GetDuration(uint8_t seqId) const
Get duration of the super frame.
Time m_targetDuration
Target duration time for sequence.
double GetCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get the bandwidth of the requested carrier.
uint32_t GetCarrierCount() const
Get carrier count of the super frame sequence.
Ptr< SatWaveformConf > m_wfConf
Waveform configurations.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.