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

#include <PrimitiveFrameSequences.h>

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

Implements inet::ieee80211::IFrameSequence.

97 {
98  switch (step) {
99  case 0: {
100  auto receiveStep = check_and_cast<IReceiveStep *>(context->getStep(firstStep + step));
101  step++;
102  auto receivedFrame = receiveStep->getReceivedFrame();
103  return context->isForUs(receivedFrame) && receivedFrame->getType() == ST_CTS;
104  }
105  default:
106  throw cRuntimeError("Unknown step");
107  }
108 }
Definition: IFrameSequence.h:59
virtual bool isForUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:49
virtual IFrameSequenceStep * getStep(int i) const
Definition: FrameSequenceContext.h:83
Definition: Ieee80211Frame_m.h:112
int firstStep
Definition: PrimitiveFrameSequences.h:123
int step
Definition: PrimitiveFrameSequences.h:124
virtual std::string inet::ieee80211::CtsFs::getHistory ( )
inlineoverridevirtual

Implements inet::ieee80211::IFrameSequence.

131 { return "TODO"; } // TODO: completeStep = true?
IFrameSequenceStep * inet::ieee80211::CtsFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

82 {
83  switch (step) {
84  case 0: {
85  auto txStep = check_and_cast<RtsTransmitStep *>(context->getLastStep());
86  auto rtsFrame = check_and_cast<Ieee80211RTSFrame*>(txStep->getFrameToTransmit());
87  return new ReceiveStep(context->getCtsTimeout(rtsFrame));
88  }
89  case 1:
90  return nullptr;
91  default:
92  throw cRuntimeError("Unknown step");
93  }
94 }
virtual IFrameSequenceStep * getLastStep() const
Definition: FrameSequenceContext.h:84
Definition: FrameSequenceStep.h:60
Class generated from inet/linklayer/ieee80211/mac/Ieee80211Frame.msg:148 by nedtool.
Definition: Ieee80211Frame_m.h:358
virtual simtime_t getCtsTimeout(Ieee80211RTSFrame *rtsFrame) const
Definition: FrameSequenceContext.cc:44
Definition: FrameSequenceStep.h:46
int step
Definition: PrimitiveFrameSequences.h:124
void inet::ieee80211::CtsFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

76 {
77  this->firstStep = firstStep;
78  step = 0;
79 }
int firstStep
Definition: PrimitiveFrameSequences.h:123
int step
Definition: PrimitiveFrameSequences.h:124

Member Data Documentation

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

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