INET Framework for OMNeT++/OMNEST
inet::physicallayer::Ieee80211LayeredOfdmTransmitter Class Reference

#include <Ieee80211LayeredOfdmTransmitter.h>

Inheritance diagram for inet::physicallayer::Ieee80211LayeredOfdmTransmitter:
inet::physicallayer::TransmitterBase inet::physicallayer::ITransmitter inet::IPrintableObject

Public Types

enum  LevelOfDetail { PACKET_DOMAIN, BIT_DOMAIN, SYMBOL_DOMAIN, SAMPLE_DOMAIN }
 
- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 

Public Member Functions

virtual ~Ieee80211LayeredOfdmTransmitter ()
 
virtual const Ieee80211OfdmModegetMode (const Packet *packet) const
 
virtual const ITransmissioncreateTransmission (const IRadio *radio, const Packet *packet, const simtime_t startTime) const override
 Returns a transmission which describes the radio signal corresponding to the provided packet. More...
 
virtual const IEncodergetEncoder () const
 
virtual const IModulatorgetModulator () const
 
virtual const IPulseShapergetPulseShaper () const
 
virtual const IDigitalAnalogConvertergetDigitalAnalogConverter () const
 
virtual W getMaxPower () const override
 Returns the maximum transmission power above which no transmission is ever transmitted. More...
 
virtual m getMaxCommunicationRange () const override
 Returns the maximum communication range. More...
 
virtual m getMaxInterferenceRange () const override
 Returns the maximum interference range. More...
 
const Hz getBandwidth () const
 
const Hz getCenterFrequency () const
 
const Hz getCarrierSpacing () const
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints this object to the provided output stream. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Protected Member Functions

virtual void initialize (int stage) override
 
const ITransmissionPacketModelcreateSignalFieldPacketModel (const ITransmissionPacketModel *completePacketModel) const
 
const ITransmissionPacketModelcreateDataFieldPacketModel (const ITransmissionPacketModel *completePacketModel) const
 
virtual const ITransmissionPacketModelcreatePacketModel (const Packet *packet) const
 
const ITransmissionSymbolModelcreateSymbolModel (const ITransmissionSymbolModel *signalFieldSymbolModel, const ITransmissionSymbolModel *dataFieldSymbolModel) const
 
const ITransmissionBitModelcreateBitModel (const ITransmissionBitModel *signalFieldBitModel, const ITransmissionBitModel *dataFieldBitModel, const ITransmissionPacketModel *packetModel) const
 
void encodeAndModulate (const ITransmissionPacketModel *packetModel, const ITransmissionBitModel *&fieldBitModel, const ITransmissionSymbolModel *&fieldSymbolModel, const IEncoder *encoder, const IModulator *modulator, bool isSignalField) const
 
const ITransmissionSampleModelcreateSampleModel (const ITransmissionSymbolModel *symbolModel) const
 
const ITransmissionAnalogModelcreateAnalogModel (const ITransmissionPacketModel *packetModel, const ITransmissionBitModel *bitModel, const ITransmissionSymbolModel *symbolModel, const ITransmissionSampleModel *sampleModel) const
 
const ITransmissionAnalogModelcreateScalarAnalogModel (const ITransmissionPacketModel *packetModel, const ITransmissionBitModel *bitModel) const
 
const Ieee80211OfdmModecomputeMode (Hz bandwidth) const
 
- Protected Member Functions inherited from inet::physicallayer::TransmitterBase
virtual int numInitStages () const override
 

Protected Attributes

LevelOfDetail levelOfDetail
 
const Ieee80211OfdmModemode = nullptr
 
const IEncodersignalEncoder = nullptr
 
const IEncoderdataEncoder = nullptr
 
const IModulatorsignalModulator = nullptr
 
const IModulatordataModulator = nullptr
 
const IPulseShaperpulseShaper = nullptr
 
const IDigitalAnalogConverterdigitalAnalogConverter = nullptr
 
bool isCompliant
 
Hz bandwidth
 
Hz channelSpacing
 
Hz centerFrequency
 
W power
 

Member Enumeration Documentation

◆ LevelOfDetail

Enumerator
PACKET_DOMAIN 
BIT_DOMAIN 
SYMBOL_DOMAIN 
SAMPLE_DOMAIN 
29  {
31  BIT_DOMAIN,
34  };

Constructor & Destructor Documentation

◆ ~Ieee80211LayeredOfdmTransmitter()

inet::physicallayer::Ieee80211LayeredOfdmTransmitter::~Ieee80211LayeredOfdmTransmitter ( )
virtual
315 {
316  if (!isCompliant) {
317  delete mode->getDataMode()->getModulation();
318  delete mode->getSignalMode()->getModulation();
319  delete mode->getPreambleMode();
320  delete mode->getSignalMode();
321  delete mode->getDataMode();
322  delete mode;
323  }
324 }

Member Function Documentation

◆ computeMode()

const Ieee80211OfdmMode * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::computeMode ( Hz  bandwidth) const
protected
266 {
267  const Ieee80211OfdmEncoderModule *ofdmSignalEncoderModule = check_and_cast<const Ieee80211OfdmEncoderModule *>(signalEncoder);
268  const Ieee80211OfdmEncoderModule *ofdmDataEncoderModule = check_and_cast<const Ieee80211OfdmEncoderModule *>(dataEncoder);
269  const Ieee80211OfdmModulatorModule *ofdmSignalModulatorModule = check_and_cast<const Ieee80211OfdmModulatorModule *>(signalModulator);
270  const Ieee80211OfdmModulatorModule *ofdmDataModulatorModule = check_and_cast<const Ieee80211OfdmModulatorModule *>(dataModulator);
271  const Ieee80211OfdmSignalMode *signalMode = new Ieee80211OfdmSignalMode(ofdmSignalEncoderModule->getCode(), ofdmSignalModulatorModule->getModulation(), channelSpacing, bandwidth, 0);
272  const Ieee80211OfdmDataMode *dataMode = new Ieee80211OfdmDataMode(ofdmDataEncoderModule->getCode(), ofdmDataModulatorModule->getModulation(), channelSpacing, bandwidth);
273  return new Ieee80211OfdmMode("", new Ieee80211OfdmPreambleMode(channelSpacing), signalMode, dataMode, channelSpacing, bandwidth);
274 }

Referenced by initialize().

◆ createAnalogModel()

const ITransmissionAnalogModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createAnalogModel ( const ITransmissionPacketModel packetModel,
const ITransmissionBitModel bitModel,
const ITransmissionSymbolModel symbolModel,
const ITransmissionSampleModel sampleModel 
) const
protected
252 {
253  const ITransmissionAnalogModel *analogModel = nullptr;
255  if (!sampleModel)
256  analogModel = digitalAnalogConverter->convertDigitalToAnalog(sampleModel);
257  else
258  throw cRuntimeError("Digital/analog converter needs sample representation");
259  }
260  else // TODO Analog model is obligatory, currently we use scalar analog model as default analog model
261  analogModel = createScalarAnalogModel(packetModel, bitModel);
262  return analogModel;
263 }

Referenced by createTransmission().

◆ createBitModel()

const ITransmissionBitModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createBitModel ( const ITransmissionBitModel signalFieldBitModel,
const ITransmissionBitModel dataFieldBitModel,
const ITransmissionPacketModel packetModel 
) const
protected
215 {
216  if (levelOfDetail >= BIT_DOMAIN) {
217  BitVector *encodedBits = new BitVector(*signalFieldBitModel->getBits());
218  unsigned int signalBitLength = signalFieldBitModel->getBits()->getSize();
219  const BitVector *dataFieldBits = dataFieldBitModel->getBits();
220  unsigned int dataBitLength = dataFieldBits->getSize();
221  for (unsigned int i = 0; i < dataFieldBits->getSize(); i++)
222  encodedBits->appendBit(dataFieldBits->getBit(i));
223  const TransmissionBitModel *transmissionBitModel = new TransmissionBitModel(b(signalBitLength), mode->getSignalMode()->getGrossBitrate(), b(dataBitLength), mode->getDataMode()->getGrossBitrate(), encodedBits, dataFieldBitModel->getForwardErrorCorrection(), dataFieldBitModel->getScrambling(), dataFieldBitModel->getInterleaving());
224  delete signalFieldBitModel;
225  delete dataFieldBitModel;
226  return transmissionBitModel;
227  }
228  // TODO
229  return new TransmissionBitModel(b(-1), mode->getSignalMode()->getGrossBitrate(), b(-1), mode->getDataMode()->getGrossBitrate(), nullptr, nullptr, nullptr, nullptr);
230 }

Referenced by createTransmission().

◆ createDataFieldPacketModel()

const ITransmissionPacketModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createDataFieldPacketModel ( const ITransmissionPacketModel completePacketModel) const
protected
148 {
149  auto packet = completePacketModel->getPacket();
150  const auto& dataChunk = packet->peekAt(b(NUMBER_OF_OFDM_DATA_SUBCARRIERS / 2), packet->getTotalLength() - b(NUMBER_OF_OFDM_DATA_SUBCARRIERS / 2));
151  return new TransmissionPacketModel(new Packet(nullptr, dataChunk), bps(NaN));
152 }

Referenced by encodeAndModulate().

◆ createPacketModel()

const ITransmissionPacketModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createPacketModel ( const Packet packet) const
protectedvirtual
95 {
96  return new TransmissionPacketModel(packet, mode->getDataMode()->getNetBitrate());
97 }

Referenced by createTransmission().

◆ createSampleModel()

const ITransmissionSampleModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createSampleModel ( const ITransmissionSymbolModel symbolModel) const
protected
233 {
234  if (levelOfDetail >= SAMPLE_DOMAIN) {
235  throw cRuntimeError("This level of detail is unimplemented.");
236 // if (symbolModel)
237 // {
238 // if (pulseShaper) // non-compliant mode
239 // sampleModel = pulseShaper->shape(symbolModel);
240 // else // compliant mode
241 // {
242 // }
243 // }
244 // else
245 // throw cRuntimeError("Pulse shaper needs symbol representation");
246  }
247  else
248  return nullptr;
249 }

Referenced by createTransmission().

◆ createScalarAnalogModel()

const ITransmissionAnalogModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createScalarAnalogModel ( const ITransmissionPacketModel packetModel,
const ITransmissionBitModel bitModel 
) const
protected
100 {
101  int headerBitLength = -1;
102  int dataBitLength = -1;
104  headerBitLength = b(bitModel->getHeaderLength()).get();
105  dataBitLength = b(bitModel->getDataLength()).get();
106  }
107  else {
108  if (isCompliant) {
109  const ConvolutionalCode *convolutionalCode = mode->getDataMode()->getCode()->getConvolutionalCode();
110  headerBitLength = ENCODED_SIGNAL_FIELD_LENGTH;
111  dataBitLength = convolutionalCode->getEncodedLength((packetModel->getPacket()->getByteLength() * 8 - DECODED_SIGNAL_FIELD_LENGTH));
112  }
113  else {
114  throw cRuntimeError("Unimplemented");
115  }
116  }
117  simtime_t preambleDuration = mode->getPreambleMode()->getDuration();
118  simtime_t headerDuration = 0;
119  if (!isCompliant) {
120  unsigned int headerCodeWordSize = mode->getSignalMode()->getModulation()->getSubcarrierModulation()->getCodeWordSize();
121  ASSERT(headerBitLength % headerCodeWordSize == 0);
122  unsigned int numberOfSignalApskSymbols = headerBitLength / headerCodeWordSize;
123  unsigned int numberOfSignalOFDMSymbols = numberOfSignalApskSymbols / NUMBER_OF_OFDM_DATA_SUBCARRIERS;
124  headerDuration = numberOfSignalOFDMSymbols * mode->getSymbolInterval();
125  }
126  else
127  headerDuration = mode->getSignalMode()->getDuration();
128  unsigned int dataCodeWordSize = mode->getDataMode()->getModulation()->getSubcarrierModulation()->getCodeWordSize();
129  ASSERT(dataBitLength % dataCodeWordSize == 0);
130  unsigned int numberOfDataApskSymbols = dataBitLength / dataCodeWordSize;
131  unsigned int numberOfDataOFDMSymbols = numberOfDataApskSymbols / NUMBER_OF_OFDM_DATA_SUBCARRIERS;
132  simtime_t dataDuration = numberOfDataOFDMSymbols * mode->getSymbolInterval();
133  simtime_t duration = preambleDuration + headerDuration + dataDuration;
134  // TODO: centerFrequency doesn't take the channel into account
135  return new ScalarTransmissionSignalAnalogModel(duration, centerFrequency, mode->getDataMode()->getBandwidth(), power);
136 }

Referenced by createAnalogModel().

◆ createSignalFieldPacketModel()

const ITransmissionPacketModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createSignalFieldPacketModel ( const ITransmissionPacketModel completePacketModel) const
protected
139 {
140  // The SIGNAL field is composed of RATE (4), Reserved (1), LENGTH (12), Parity (1), Tail (6),
141  // fields, so the SIGNAL field is 24 bits (OFDM_SYMBOL_SIZE / 2) long.
142  auto packet = completePacketModel->getPacket();
143  const auto& signalChunk = packet->peekAt(b(0), b(NUMBER_OF_OFDM_DATA_SUBCARRIERS / 2));
144  return new TransmissionPacketModel(new Packet(nullptr, signalChunk), bps(NaN));
145 }

Referenced by encodeAndModulate().

◆ createSymbolModel()

const ITransmissionSymbolModel * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createSymbolModel ( const ITransmissionSymbolModel signalFieldSymbolModel,
const ITransmissionSymbolModel dataFieldSymbolModel 
) const
protected
192 {
193  if (levelOfDetail >= SYMBOL_DOMAIN) {
194  const std::vector<const ISymbol *> *signalSymbols = signalFieldSymbolModel->getSymbols();
195  std::vector<const ISymbol *> *mergedSymbols = new std::vector<const ISymbol *>();
196  const Ieee80211OfdmSymbol *ofdmSymbol = nullptr;
197  for (auto& signalSymbol : *signalSymbols) {
198  ofdmSymbol = check_and_cast<const Ieee80211OfdmSymbol *>(signalSymbol);
199  mergedSymbols->push_back(new Ieee80211OfdmSymbol(*ofdmSymbol));
200  }
201  const std::vector<const ISymbol *> *dataSymbols = dataFieldSymbolModel->getSymbols();
202  for (auto& dataSymbol : *dataSymbols) {
203  ofdmSymbol = dynamic_cast<const Ieee80211OfdmSymbol *>(dataSymbol);
204  mergedSymbols->push_back(new Ieee80211OfdmSymbol(*ofdmSymbol));
205  }
206  const Ieee80211OfdmTransmissionSymbolModel *transmissionSymbolModel = new Ieee80211OfdmTransmissionSymbolModel(1, 1.0 / mode->getSignalMode()->getDuration(), mergedSymbols->size() - 1, 1.0 / mode->getSymbolInterval(), mergedSymbols, signalFieldSymbolModel->getHeaderModulation(), dataFieldSymbolModel->getPayloadModulation());
207  delete signalFieldSymbolModel;
208  delete dataFieldSymbolModel;
209  return transmissionSymbolModel;
210  }
211  return new Ieee80211OfdmTransmissionSymbolModel(-1, NaN, -1, NaN, nullptr, mode->getSignalMode()->getModulation()->getSubcarrierModulation(), mode->getDataMode()->getModulation()->getSubcarrierModulation());
212 }

Referenced by createTransmission().

◆ createTransmission()

const ITransmission * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createTransmission ( const IRadio transmitter,
const Packet packet,
const simtime_t  startTime 
) const
overridevirtual

Returns a transmission which describes the radio signal corresponding to the provided packet.

This function never returns nullptr.

Implements inet::physicallayer::ITransmitter.

286 {
287  mode = getMode(packet);
288  const ITransmissionBitModel *bitModel = nullptr;
289  const ITransmissionBitModel *signalFieldBitModel = nullptr;
290  const ITransmissionBitModel *dataFieldBitModel = nullptr;
291  const ITransmissionSymbolModel *symbolModel = nullptr;
292  const ITransmissionSymbolModel *signalFieldSymbolModel = nullptr;
293  const ITransmissionSymbolModel *dataFieldSymbolModel = nullptr;
294  const ITransmissionSampleModel *sampleModel = nullptr;
295  const ITransmissionAnalogModel *analogModel = nullptr;
296  const ITransmissionPacketModel *packetModel = createPacketModel(packet);
297  encodeAndModulate(packetModel, signalFieldBitModel, signalFieldSymbolModel, signalEncoder, signalModulator, true);
298  encodeAndModulate(packetModel, dataFieldBitModel, dataFieldSymbolModel, dataEncoder, dataModulator, false);
299  bitModel = createBitModel(signalFieldBitModel, dataFieldBitModel, packetModel);
300  symbolModel = createSymbolModel(signalFieldSymbolModel, dataFieldSymbolModel);
301  sampleModel = createSampleModel(symbolModel);
302  analogModel = createAnalogModel(packetModel, bitModel, symbolModel, sampleModel);
303  IMobility *mobility = transmitter->getAntenna()->getMobility();
304  // assuming movement and rotation during transmission is negligible
305  const simtime_t endTime = startTime + analogModel->getDuration();
306  const Coord& startPosition = mobility->getCurrentPosition();
307  const Coord& endPosition = mobility->getCurrentPosition();
308  const Quaternion& startOrientation = mobility->getCurrentAngularPosition();
309  const Quaternion& endOrientation = mobility->getCurrentAngularPosition();
310  // TODO compute channel
311  return new Ieee80211LayeredTransmission(packetModel, bitModel, symbolModel, sampleModel, analogModel, transmitter, packet, startTime, endTime, -1, -1, -1, startPosition, endPosition, startOrientation, endOrientation, mode, nullptr);
312 }

◆ encodeAndModulate()

void inet::physicallayer::Ieee80211LayeredOfdmTransmitter::encodeAndModulate ( const ITransmissionPacketModel packetModel,
const ITransmissionBitModel *&  fieldBitModel,
const ITransmissionSymbolModel *&  fieldSymbolModel,
const IEncoder encoder,
const IModulator modulator,
bool  isSignalField 
) const
protected
155 {
156  const ITransmissionPacketModel *fieldPacketModel = nullptr;
157  if (isSignalField)
158  fieldPacketModel = createSignalFieldPacketModel(packetModel);
159  else
160  fieldPacketModel = createDataFieldPacketModel(packetModel);
161  if (levelOfDetail >= BIT_DOMAIN) {
162  if (fieldPacketModel) {
163  if (encoder) // non-compliant mode
164  fieldBitModel = encoder->encode(fieldPacketModel);
165  else { // compliant mode
166  const Ieee80211OfdmCode *code = isSignalField ? mode->getSignalMode()->getCode() : mode->getDataMode()->getCode();
167  const Ieee80211OfdmEncoder encoder(code);
168  fieldBitModel = encoder.encode(fieldPacketModel);
169  }
170  }
171  else
172  throw cRuntimeError("Encoder needs packet representation");
173  }
174  if (levelOfDetail >= SYMBOL_DOMAIN) {
175  if (fieldBitModel) {
176  if (modulator) // non-compliant mode
177  fieldSymbolModel = modulator->modulate(fieldBitModel);
178  else { // compliant mode
179  const Ieee80211OfdmModulation *ofdmModulation = isSignalField ? mode->getSignalMode()->getModulation() : mode->getDataMode()->getModulation();
180  Ieee80211OfdmModulator modulator(ofdmModulation, isSignalField ? 0 : 1);
181  fieldSymbolModel = modulator.modulate(fieldBitModel);
182  }
183  }
184  else
185  throw cRuntimeError("Modulator needs bit representation");
186  }
187  delete fieldPacketModel->getPacket();
188  delete fieldPacketModel;
189 }

Referenced by createTransmission().

◆ getBandwidth()

const Hz inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getBandwidth ( ) const
inline
86 { return mode->getDataMode()->getBandwidth(); }

◆ getCarrierSpacing()

const Hz inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getCarrierSpacing ( ) const
inline
88 { return mode->getChannelSpacing(); }

◆ getCenterFrequency()

const Hz inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getCenterFrequency ( ) const
inline
87 { return centerFrequency; }

◆ getDigitalAnalogConverter()

virtual const IDigitalAnalogConverter* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getDigitalAnalogConverter ( ) const
inlinevirtual
82 { return digitalAnalogConverter; }

◆ getEncoder()

virtual const IEncoder* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getEncoder ( ) const
inlinevirtual
79 { return dataEncoder; }

◆ getMaxCommunicationRange()

virtual m inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getMaxCommunicationRange ( ) const
inlineoverridevirtual

Returns the maximum communication range.

Returns a value in the range [0, +infinity] or NaN if unspecified.

Reimplemented from inet::physicallayer::TransmitterBase.

84 { return m(NaN); }

◆ getMaxInterferenceRange()

virtual m inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getMaxInterferenceRange ( ) const
inlineoverridevirtual

Returns the maximum interference range.

Returns a value in the range [0, +infinity] or NaN if unspecified.

Reimplemented from inet::physicallayer::TransmitterBase.

85 { return m(NaN); }

◆ getMaxPower()

virtual W inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getMaxPower ( ) const
inlineoverridevirtual

Returns the maximum transmission power above which no transmission is ever transmitted.

Returns a value in the range [0, +infinity] or NaN if unspecified.

Reimplemented from inet::physicallayer::TransmitterBase.

83 { return power; }

◆ getMode()

const Ieee80211OfdmMode * inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getMode ( const Packet packet) const
virtual
277 {
278  const auto& modeReq = const_cast<Packet *>(packet)->findTag<Ieee80211ModeReq>();
279  if (isCompliant)
280  return modeReq != nullptr ? check_and_cast<const Ieee80211OfdmMode *>(modeReq->getMode()) : &Ieee80211OfdmCompliantModes::getCompliantMode(11, MHz(20));
281  else
282  return mode;
283 }

Referenced by createTransmission().

◆ getModulator()

virtual const IModulator* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getModulator ( ) const
inlinevirtual
80 { return dataModulator; }

◆ getPulseShaper()

virtual const IPulseShaper* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getPulseShaper ( ) const
inlinevirtual
81 { return pulseShaper; }

◆ initialize()

void inet::physicallayer::Ieee80211LayeredOfdmTransmitter::initialize ( int  stage)
overrideprotectedvirtual
38 {
39  if (stage == INITSTAGE_LOCAL) {
40  isCompliant = par("isCompliant");
41  dataEncoder = dynamic_cast<const IEncoder *>(getSubmodule("dataEncoder"));
42  signalEncoder = dynamic_cast<const IEncoder *>(getSubmodule("signalEncoder"));
43  dataModulator = dynamic_cast<const IModulator *>(getSubmodule("dataModulator"));
44  signalModulator = dynamic_cast<const IModulator *>(getSubmodule("signalModulator"));
45  pulseShaper = dynamic_cast<const IPulseShaper *>(getSubmodule("pulseShaper"));
46  digitalAnalogConverter = dynamic_cast<const IDigitalAnalogConverter *>(getSubmodule("digitalAnalogConverter"));
47  channelSpacing = Hz(par("channelSpacing"));
48  power = W(par("power"));
49  centerFrequency = Hz(par("centerFrequency"));
50  bandwidth = Hz(par("bandwidth"));
52  || pulseShaper || digitalAnalogConverter || !std::isnan(channelSpacing.get()))) // TODO check modulations
53  {
54  throw cRuntimeError("In compliant mode it is forbidden to set the following parameters: dataEncoder, signalEncoder, modulator, signalModulator, pulseShaper, digitalAnalogConverter, bandwidth, channelSpacing");
55  }
56  const char *levelOfDetailStr = par("levelOfDetail");
57  if (strcmp("bit", levelOfDetailStr) == 0)
59  else if (strcmp("symbol", levelOfDetailStr) == 0)
61  else if (strcmp("sample", levelOfDetailStr) == 0)
63  else if (strcmp("packet", levelOfDetailStr) == 0)
65  else
66  throw cRuntimeError("Unknown level of detail='%s'", levelOfDetailStr);
67  }
68  else if (stage == INITSTAGE_LAST) {
69  if (!isCompliant)
71  }
72 }

◆ printToStream()

std::ostream & inet::physicallayer::Ieee80211LayeredOfdmTransmitter::printToStream ( std::ostream &  stream,
int  level,
int  evFlags = 0 
) const
overridevirtual

Prints this object to the provided output stream.

Reimplemented from inet::IPrintableObject.

75 {
76  stream << "Ieee80211LayeredOfdmTransmitter";
77  if (level <= PRINT_LEVEL_TRACE)
78  stream << EV_FIELD(levelOfDetail)
79  << EV_FIELD(mode, printFieldToString(mode, level + 1, evFlags))
90  << EV_FIELD(power);
91  return stream;
92 }

Member Data Documentation

◆ bandwidth

Hz inet::physicallayer::Ieee80211LayeredOfdmTransmitter::bandwidth
protected

◆ centerFrequency

Hz inet::physicallayer::Ieee80211LayeredOfdmTransmitter::centerFrequency
protected

◆ channelSpacing

Hz inet::physicallayer::Ieee80211LayeredOfdmTransmitter::channelSpacing
protected

◆ dataEncoder

const IEncoder* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::dataEncoder = nullptr
protected

◆ dataModulator

const IModulator* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::dataModulator = nullptr
protected

◆ digitalAnalogConverter

const IDigitalAnalogConverter* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::digitalAnalogConverter = nullptr
protected

◆ isCompliant

bool inet::physicallayer::Ieee80211LayeredOfdmTransmitter::isCompliant
protected

◆ levelOfDetail

LevelOfDetail inet::physicallayer::Ieee80211LayeredOfdmTransmitter::levelOfDetail
protected

◆ mode

◆ power

W inet::physicallayer::Ieee80211LayeredOfdmTransmitter::power
protected

◆ pulseShaper

const IPulseShaper* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::pulseShaper = nullptr
protected

Referenced by initialize(), and printToStream().

◆ signalEncoder

const IEncoder* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::signalEncoder = nullptr
protected

◆ signalModulator

const IModulator* inet::physicallayer::Ieee80211LayeredOfdmTransmitter::signalModulator = nullptr
protected

The documentation for this class was generated from the following files:
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::power
W power
Definition: Ieee80211LayeredOfdmTransmitter.h:50
inet::INITSTAGE_LAST
INET_API InitStage INITSTAGE_LAST
Operations that no other initializations can depend on, e.g.
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::SYMBOL_DOMAIN
@ SYMBOL_DOMAIN
Definition: Ieee80211LayeredOfdmTransmitter.h:32
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createBitModel
const ITransmissionBitModel * createBitModel(const ITransmissionBitModel *signalFieldBitModel, const ITransmissionBitModel *dataFieldBitModel, const ITransmissionPacketModel *packetModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:214
inet::units::units::Hz
pow< s, -1 > Hz
Definition: Units.h:935
inet::physicallayer::ApskModulationBase::getCodeWordSize
virtual unsigned int getCodeWordSize() const override
Definition: ApskModulationBase.h:37
inet::physicallayer::Ieee80211OfdmDataMode::getGrossBitrate
virtual bps getGrossBitrate() const override
Definition: Ieee80211OfdmMode.h:125
inet::physicallayer::Ieee80211OfdmSignalMode::getDuration
virtual const simtime_t getDuration() const override
Definition: Ieee80211OfdmMode.h:96
inet::units::units::bps
compose< b, pow< s, -1 > > bps
Definition: Units.h:1169
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::encodeAndModulate
void encodeAndModulate(const ITransmissionPacketModel *packetModel, const ITransmissionBitModel *&fieldBitModel, const ITransmissionSymbolModel *&fieldSymbolModel, const IEncoder *encoder, const IModulator *modulator, bool isSignalField) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:154
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::BIT_DOMAIN
@ BIT_DOMAIN
Definition: Ieee80211LayeredOfdmTransmitter.h:31
inet::physicallayer::IDigitalAnalogConverter::convertDigitalToAnalog
virtual const ITransmissionAnalogModel * convertDigitalToAnalog(const ITransmissionSampleModel *sampleModel) const =0
inet::units::units::W
compose< J, pow< s, -1 > > W
Definition: Units.h:939
inet::physicallayer::Ieee80211OfdmDataMode::getNetBitrate
virtual bps getNetBitrate() const override
Definition: Ieee80211OfdmMode.h:126
NUMBER_OF_OFDM_DATA_SUBCARRIERS
#define NUMBER_OF_OFDM_DATA_SUBCARRIERS
Definition: Ieee80211OfdmDefs.h:15
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::signalModulator
const IModulator * signalModulator
Definition: Ieee80211LayeredOfdmTransmitter.h:41
inet::physicallayer::Ieee80211OfdmPreambleMode::getDuration
virtual const simtime_t getDuration() const override
Definition: Ieee80211OfdmMode.h:71
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::bandwidth
Hz bandwidth
Definition: Ieee80211LayeredOfdmTransmitter.h:47
DECODED_SIGNAL_FIELD_LENGTH
#define DECODED_SIGNAL_FIELD_LENGTH
Definition: Ieee80211OfdmDefs.h:16
inet::physicallayer::Ieee80211OfdmDataMode::getCode
const Ieee80211OfdmCode * getCode() const
Definition: Ieee80211OfdmMode.h:123
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::SAMPLE_DOMAIN
@ SAMPLE_DOMAIN
Definition: Ieee80211LayeredOfdmTransmitter.h:33
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createAnalogModel
const ITransmissionAnalogModel * createAnalogModel(const ITransmissionPacketModel *packetModel, const ITransmissionBitModel *bitModel, const ITransmissionSymbolModel *symbolModel, const ITransmissionSampleModel *sampleModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:251
inet::physicallayer::Ieee80211OfdmSignalMode::getModulation
const Ieee80211OfdmModulation * getModulation() const override
Definition: Ieee80211OfdmMode.h:99
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createScalarAnalogModel
const ITransmissionAnalogModel * createScalarAnalogModel(const ITransmissionPacketModel *packetModel, const ITransmissionBitModel *bitModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:99
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::centerFrequency
Hz centerFrequency
Definition: Ieee80211LayeredOfdmTransmitter.h:49
inet::printFieldToString
std::string printFieldToString(const IPrintableObject *object, int level, int evFlags=0)
Definition: IPrintableObject.h:98
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::isCompliant
bool isCompliant
Definition: Ieee80211LayeredOfdmTransmitter.h:45
ENCODED_SIGNAL_FIELD_LENGTH
#define ENCODED_SIGNAL_FIELD_LENGTH
Definition: Ieee80211OfdmDefs.h:17
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createSignalFieldPacketModel
const ITransmissionPacketModel * createSignalFieldPacketModel(const ITransmissionPacketModel *completePacketModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:138
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::computeMode
const Ieee80211OfdmMode * computeMode(Hz bandwidth) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:265
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::physicallayer::Ieee80211OfdmSignalMode::getGrossBitrate
virtual bps getGrossBitrate() const override
Definition: Ieee80211OfdmMode.h:101
inet::physicallayer::Ieee80211OfdmMode::getPreambleMode
virtual const Ieee80211OfdmPreambleMode * getPreambleMode() const override
Definition: Ieee80211OfdmMode.h:146
inet::physicallayer::Ieee80211OfdmMode::getSignalMode
virtual const Ieee80211OfdmSignalMode * getSignalMode() const
Definition: Ieee80211OfdmMode.h:149
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::dataEncoder
const IEncoder * dataEncoder
Definition: Ieee80211LayeredOfdmTransmitter.h:40
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::levelOfDetail
LevelOfDetail levelOfDetail
Definition: Ieee80211LayeredOfdmTransmitter.h:37
NaN
#define NaN
Definition: INETMath.h:91
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::physicallayer::Ieee80211OfdmSignalMode::getCode
const Ieee80211OfdmCode * getCode() const
Definition: Ieee80211OfdmMode.h:98
inet::physicallayer::Ieee80211OfdmModulation::getSubcarrierModulation
const ApskModulationBase * getSubcarrierModulation() const
Definition: Ieee80211OfdmModulation.h:24
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::mode
const Ieee80211OfdmMode * mode
Definition: Ieee80211LayeredOfdmTransmitter.h:38
inet::IPrintableObject::PRINT_LEVEL_TRACE
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createPacketModel
virtual const ITransmissionPacketModel * createPacketModel(const Packet *packet) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:94
inet::evFlags
int evFlags
Definition: INETDefs.cc:12
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::pulseShaper
const IPulseShaper * pulseShaper
Definition: Ieee80211LayeredOfdmTransmitter.h:43
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::dataModulator
const IModulator * dataModulator
Definition: Ieee80211LayeredOfdmTransmitter.h:42
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::signalEncoder
const IEncoder * signalEncoder
Definition: Ieee80211LayeredOfdmTransmitter.h:39
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::digitalAnalogConverter
const IDigitalAnalogConverter * digitalAnalogConverter
Definition: Ieee80211LayeredOfdmTransmitter.h:44
inet::units::value::get
const value_type & get() const
Definition: Units.h:108
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::PACKET_DOMAIN
@ PACKET_DOMAIN
Definition: Ieee80211LayeredOfdmTransmitter.h:30
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::channelSpacing
Hz channelSpacing
Definition: Ieee80211LayeredOfdmTransmitter.h:48
inet::physicallayer::Ieee80211OfdmMode::getDataMode
virtual const Ieee80211OfdmDataMode * getDataMode() const override
Definition: Ieee80211OfdmMode.h:148
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createDataFieldPacketModel
const ITransmissionPacketModel * createDataFieldPacketModel(const ITransmissionPacketModel *completePacketModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:147
inet::units::units::MHz
mega< Hz >::type MHz
Definition: Units.h:1083
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::getMode
virtual const Ieee80211OfdmMode * getMode(const Packet *packet) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:276
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
inet::physicallayer::Ieee80211OfdmDataMode::getModulation
const Ieee80211OfdmModulation * getModulation() const override
Definition: Ieee80211OfdmMode.h:124
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createSymbolModel
const ITransmissionSymbolModel * createSymbolModel(const ITransmissionSymbolModel *signalFieldSymbolModel, const ITransmissionSymbolModel *dataFieldSymbolModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:191
inet::physicallayer::Ieee80211OfdmDataMode::getBandwidth
virtual Hz getBandwidth() const override
Definition: Ieee80211OfdmMode.h:118
inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createSampleModel
const ITransmissionSampleModel * createSampleModel(const ITransmissionSymbolModel *symbolModel) const
Definition: Ieee80211LayeredOfdmTransmitter.cc:232
inet::physicallayer::Ieee80211OfdmCode::getConvolutionalCode
const ConvolutionalCode * getConvolutionalCode() const
Definition: Ieee80211OfdmCode.h:31