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

#include <PrimitiveFrameSequences.h>

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

Implements inet::ieee80211::IFrameSequence.

168 {
169  switch (step) {
170  case 0:
171  step++;
172  return true;
173  case 1: {
174  auto receiveStep = check_and_cast<IReceiveStep*>(context->getStep(firstStep + step));
175  step++;
176  auto receivedFrame = receiveStep->getReceivedFrame();
177  return context->isForUs(receivedFrame) && receivedFrame->getType() == ST_ACK;
178  }
179  default:
180  throw cRuntimeError("Unknown step");
181  }
182 }
Definition: IFrameSequence.h:59
int step
Definition: PrimitiveFrameSequences.h:58
virtual bool isForUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:49
Definition: Ieee80211Frame_m.h:113
int firstStep
Definition: PrimitiveFrameSequences.h:57
virtual IFrameSequenceStep * getStep(int i) const
Definition: FrameSequenceContext.h:83
virtual std::string inet::ieee80211::ManagementAckFs::getHistory ( )
inlineoverridevirtual

Implements inet::ieee80211::IFrameSequence.

65 { return "MANAGEMENT"; }
IFrameSequenceStep * inet::ieee80211::ManagementAckFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

148 {
149  switch (step) {
150  case 0: {
151  auto mgmtFrame = check_and_cast<Ieee80211ManagementFrame *>(context->getInProgressFrames()->getFrameToTransmit());
152  return new TransmitStep(mgmtFrame, context->getIfs());
153  }
154  case 1: {
155  auto txStep = check_and_cast<TransmitStep*>(context->getLastStep());
156  auto mgmtFrame = check_and_cast<Ieee80211ManagementFrame*>(txStep->getFrameToTransmit());
157  return new ReceiveStep(context->getAckTimeout(mgmtFrame));
158  }
159  case 2:
160  return nullptr;
161 
162  default:
163  throw cRuntimeError("Unknown step");
164  }
165 }
virtual IFrameSequenceStep * getLastStep() const
Definition: FrameSequenceContext.h:84
virtual simtime_t getIfs() const
Definition: FrameSequenceContext.cc:34
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
int step
Definition: PrimitiveFrameSequences.h:58
Class generated from inet/linklayer/ieee80211/mac/Ieee80211Frame.msg:217 by nedtool.
Definition: Ieee80211Frame_m.h:604
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::ManagementAckFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

142 {
143  this->firstStep = firstStep;
144  step = 0;
145 }
int step
Definition: PrimitiveFrameSequences.h:58
int firstStep
Definition: PrimitiveFrameSequences.h:57

Member Data Documentation

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

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