INET Framework for OMNeT++/OMNEST
inet::ieee80211::FragFrameAckFs Class Reference

#include <PrimitiveFrameSequences.h>

Inheritance diagram for inet::ieee80211::FragFrameAckFs:
inet::ieee80211::IFrameSequence

Public Member Functions

virtual void startSequence (FrameSequenceContext *context, int firstStep) override
 
virtual IFrameSequenceStepprepareStep (FrameSequenceContext *context) override
 
virtual bool completeStep (FrameSequenceContext *context) override
 
virtual std::string getHistory () override
 
- Public Member Functions inherited from inet::ieee80211::IFrameSequence
virtual ~IFrameSequence ()
 

Protected Attributes

int firstStep = -1
 
int step = -1
 

Member Function Documentation

bool inet::ieee80211::FragFrameAckFs::completeStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

319 {
320  switch (step) {
321  case 0:
322  step++;
323  return true;
324  case 1: {
325  auto receiveStep = check_and_cast<IReceiveStep *>(context->getStep(firstStep + step));
326  step++;
327  auto receivedFrame = receiveStep->getReceivedFrame();
328  return context->isForUs(receivedFrame) && receivedFrame->getType() == ST_ACK;
329  }
330  default:
331  throw cRuntimeError("Unknown step");
332  }
333 }
Definition: IFrameSequence.h:59
int step
Definition: PrimitiveFrameSequences.h:138
virtual bool isForUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:49
Definition: Ieee80211Frame_m.h:113
virtual IFrameSequenceStep * getStep(int i) const
Definition: FrameSequenceContext.h:83
int firstStep
Definition: PrimitiveFrameSequences.h:137
virtual std::string inet::ieee80211::FragFrameAckFs::getHistory ( )
inlineoverridevirtual

Implements inet::ieee80211::IFrameSequence.

145 { return std::string("FRAG-FRAME") + (step == 2 ? " ACK" : ""); } // TODO: completeStep = true?
int step
Definition: PrimitiveFrameSequences.h:138
IFrameSequenceStep * inet::ieee80211::FragFrameAckFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

300 {
301  switch (step) {
302  case 0: {
303  auto frame = context->getInProgressFrames()->getFrameToTransmit();
304  return new TransmitStep(frame, context->getIfs());
305  }
306  case 1: {
307  auto txStep = check_and_cast<TransmitStep *>(context->getLastStep());
308  auto dataOrMgmtFrame = check_and_cast<Ieee80211DataOrMgmtFrame*>(txStep->getFrameToTransmit());
309  return new ReceiveStep(context->getAckTimeout(dataOrMgmtFrame));
310  }
311  case 2:
312  return nullptr;
313  default:
314  throw cRuntimeError("Unknown step");
315  }
316 }
virtual IFrameSequenceStep * getLastStep() const
Definition: FrameSequenceContext.h:84
int step
Definition: PrimitiveFrameSequences.h:138
Class generated from inet/linklayer/ieee80211/mac/Ieee80211Frame.msg:166 by nedtool.
Definition: Ieee80211Frame_m.h:438
virtual simtime_t getIfs() const
Definition: FrameSequenceContext.cc:34
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
Definition: FrameSequenceStep.h:60
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
Definition: FrameSequenceStep.h:26
virtual simtime_t getAckTimeout(Ieee80211DataOrMgmtFrame *dataOrMgmtframe) const
Definition: FrameSequenceContext.cc:39
void inet::ieee80211::FragFrameAckFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

294 {
295  this->firstStep = firstStep;
296  step = 0;
297 }
int step
Definition: PrimitiveFrameSequences.h:138
int firstStep
Definition: PrimitiveFrameSequences.h:137

Member Data Documentation

int inet::ieee80211::FragFrameAckFs::firstStep = -1
protected
int inet::ieee80211::FragFrameAckFs::step = -1
protected

The documentation for this class was generated from the following files: