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

#include <PrimitiveFrameSequences.h>

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

Implements inet::ieee80211::IFrameSequence.

237 {
238  switch (step) {
239  case 0: {
240  auto receiveStep = check_and_cast<IReceiveStep*>(context->getStep(firstStep + step));
241  step++;
242  auto receivedFrame = receiveStep->getReceivedFrame();
243  return context->isForUs(receivedFrame) && receivedFrame->getType() == ST_ACK;
244  }
245  default:
246  throw cRuntimeError("Unknown step");
247  }
248 }
Definition: IFrameSequence.h:59
virtual bool isForUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:49
int firstStep
Definition: PrimitiveFrameSequences.h:83
Definition: Ieee80211Frame_m.h:113
virtual IFrameSequenceStep * getStep(int i) const
Definition: FrameSequenceContext.h:83
int step
Definition: PrimitiveFrameSequences.h:84
virtual std::string inet::ieee80211::AckFs::getHistory ( )
inlineoverridevirtual

Implements inet::ieee80211::IFrameSequence.

91 { return "ACK"; }
IFrameSequenceStep * inet::ieee80211::AckFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

222 {
223  switch (step) {
224  case 0: {
225  auto txStep = check_and_cast<TransmitStep*>(context->getLastStep());
226  auto dataOrMgmtFrame = check_and_cast<Ieee80211DataOrMgmtFrame*>(txStep->getFrameToTransmit());
227  return new ReceiveStep(context->getAckTimeout(dataOrMgmtFrame));
228  }
229  case 1:
230  return nullptr;
231  default:
232  throw cRuntimeError("Unknown step");
233  }
234 }
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
Definition: FrameSequenceStep.h:60
Definition: FrameSequenceStep.h:26
int step
Definition: PrimitiveFrameSequences.h:84
virtual simtime_t getAckTimeout(Ieee80211DataOrMgmtFrame *dataOrMgmtframe) const
Definition: FrameSequenceContext.cc:39
void inet::ieee80211::AckFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

216 {
217  this->firstStep = firstStep;
218  step = 0;
219 }
int firstStep
Definition: PrimitiveFrameSequences.h:83
int step
Definition: PrimitiveFrameSequences.h:84

Member Data Documentation

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

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