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

#include <PrimitiveFrameSequences.h>

Inheritance diagram for inet::ieee80211::LastFrameAckFs:
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::LastFrameAckFs::completeStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

361 {
362  switch (step) {
363  case 0:
364  step++;
365  return true;
366  case 1: {
367  auto receiveStep = check_and_cast<IReceiveStep *>(context->getStep(firstStep + step));
368  step++;
369  auto receivedFrame = receiveStep->getReceivedFrame();
370  return context->isForUs(receivedFrame) && receivedFrame->getType() == ST_ACK;
371  }
372  default:
373  throw cRuntimeError("Unknown step");
374  }
375 }
Definition: IFrameSequence.h:59
int firstStep
Definition: PrimitiveFrameSequences.h:151
virtual bool isForUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:49
int step
Definition: PrimitiveFrameSequences.h:152
Definition: Ieee80211Frame_m.h:113
virtual IFrameSequenceStep * getStep(int i) const
Definition: FrameSequenceContext.h:83
virtual std::string inet::ieee80211::LastFrameAckFs::getHistory ( )
inlineoverridevirtual

Implements inet::ieee80211::IFrameSequence.

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

Implements inet::ieee80211::IFrameSequence.

342 {
343  switch (step) {
344  case 0: {
345  auto frame = context->getInProgressFrames()->getFrameToTransmit();
346  return new TransmitStep(frame, context->getIfs());
347  }
348  case 1: {
349  auto txStep = check_and_cast<TransmitStep *>(context->getLastStep());
350  auto dataOrMgmtFrame = check_and_cast<Ieee80211DataOrMgmtFrame*>(txStep->getFrameToTransmit());
351  return new ReceiveStep(context->getAckTimeout(dataOrMgmtFrame));
352  }
353  case 2:
354  return nullptr;
355  default:
356  throw cRuntimeError("Unknown step");
357  }
358 }
virtual IFrameSequenceStep * getLastStep() const
Definition: FrameSequenceContext.h:84
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
int step
Definition: PrimitiveFrameSequences.h:152
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::LastFrameAckFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

336 {
337  this->firstStep = firstStep;
338  step = 0;
339 }
int firstStep
Definition: PrimitiveFrameSequences.h:151
int step
Definition: PrimitiveFrameSequences.h:152

Member Data Documentation

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

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