24 #include <ns3/nstime.h>
25 #include <ns3/object.h>
27 NS_LOG_COMPONENT_DEFINE(
"SatSuperframeSeq");
32 NS_OBJECT_ENSURE_REGISTERED(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);
72 NS_LOG_FUNCTION(
this);
79 NS_LOG_FUNCTION(
this);
86 NS_LOG_FUNCTION(
this);
94 NS_LOG_FUNCTION(
this);
96 uint32_t carrierCount = 0;
109 NS_LOG_FUNCTION(
this << (uint32_t)seqId);
113 NS_FATAL_ERROR(
"SatSuperframeSeq::GetCarrierCount - unsupported sequence id: " << seqId);
122 NS_LOG_FUNCTION(
this << (uint32_t)seqId);
126 NS_FATAL_ERROR(
"SatSuperframeSeq::GetDuration - unsupported sequence id: " << seqId);
132 Ptr<SatSuperframeConf>
135 NS_LOG_FUNCTION(
this << (uint32_t)seqId);
139 NS_FATAL_ERROR(
"SatSuperframeSeq::GetSuperframeConf - unsupported sequence id: " << seqId);
148 NS_LOG_FUNCTION(
this << superframeId << frameId << frameCarrierId);
153 "SatSuperframeSeq::GetCarrierCount - unsupported sequence id: " << superframeId);
156 uint32_t carrierId =
m_superframe[superframeId]->GetCarrierId(frameId, frameCarrierId);
158 for (uint8_t i = 0; i < superframeId; i++)
169 NS_LOG_FUNCTION(
this << carrierId);
171 double superFrameStartFrequency = 0.0;
172 uint32_t currentSuperframe = 0;
173 uint32_t lastIdInSuperframe =
m_superframe[0]->GetCarrierCount() - 1;
174 uint32_t carrierIdInSuperframe = carrierId;
176 while (carrierId > lastIdInSuperframe)
178 carrierIdInSuperframe -=
m_superframe[currentSuperframe]->GetCarrierCount();
179 superFrameStartFrequency +=
m_superframe[currentSuperframe]->GetBandwidthHz();
181 lastIdInSuperframe +=
m_superframe[currentSuperframe]->GetCarrierCount();
184 double carrierFrequencyInSuperframe =
185 m_superframe[currentSuperframe]->GetCarrierFrequencyHz(carrierIdInSuperframe);
187 return superFrameStartFrequency + carrierFrequencyInSuperframe;
194 NS_LOG_FUNCTION(
this << carrierId);
196 uint32_t currentSuperframe = 0;
197 uint32_t lastIdInSuperframe =
m_superframe[0]->GetCarrierCount() - 1;
198 uint32_t carrierIdInSuperframe = carrierId;
200 while (carrierId > lastIdInSuperframe)
202 carrierIdInSuperframe -=
m_superframe[currentSuperframe]->GetCarrierCount();
204 lastIdInSuperframe +=
m_superframe[currentSuperframe]->GetCarrierCount();
207 return m_superframe[currentSuperframe]->GetCarrierBandwidthHz(carrierIdInSuperframe,
CarrierBandwidthType_t
Types of bandwidth.
~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.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.