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

#include <PrimitiveFrameSequences.h>

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

Implements inet::ieee80211::IFrameSequence.

407 {
408  switch (step) {
409  case 0:
410  step++;
411  return true;
412  case 1: {
413  auto receiveStep = check_and_cast<IReceiveStep*>(context->getStep(firstStep + step));
414  step++;
415  auto receivedFrame = receiveStep->getReceivedFrame();
416  return context->isForUs(receivedFrame) && receivedFrame->getType() == ST_BLOCKACK;
417  }
418  default:
419  throw cRuntimeError("Unknown step");
420  }
421 }
Definition: IFrameSequence.h:59
virtual bool isForUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:49
virtual IFrameSequenceStep * getStep(int i) const
Definition: FrameSequenceContext.h:83
int firstStep
Definition: PrimitiveFrameSequences.h:164
Definition: Ieee80211Frame_m.h:115
int step
Definition: PrimitiveFrameSequences.h:165
virtual std::string inet::ieee80211::BlockAckReqBlockAckFs::getHistory ( )
inlineoverridevirtual

Implements inet::ieee80211::IFrameSequence.

172 { return std::string("BLOCKACKREQ") + (step == 2 ? " ACK" : ""); } // TODO: completeStep = true?
int step
Definition: PrimitiveFrameSequences.h:165
IFrameSequenceStep * inet::ieee80211::BlockAckReqBlockAckFs::prepareStep ( FrameSequenceContext context)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

384 {
385  switch (step) {
386  case 0: {
387  auto blockAckReqParams = context->getQoSContext()->ackPolicy->computeBlockAckReqParameters(context->getInProgressFrames(), context->getQoSContext()->txopProcedure);
388  auto receiverAddr = std::get<0>(blockAckReqParams);
389  auto startingSequenceNumber = std::get<1>(blockAckReqParams);
390  auto tid = std::get<2>(blockAckReqParams);
391  auto blockAckReq = context->getQoSContext()->blockAckProcedure->buildBasicBlockAckReqFrame(receiverAddr, tid, startingSequenceNumber);
392  return new TransmitStep(blockAckReq, context->getIfs());
393  }
394  case 1: {
395  auto txStep = check_and_cast<ITransmitStep *>(context->getLastStep());
396  auto blockAckReq = check_and_cast<Ieee80211BlockAckReq*>(txStep->getFrameToTransmit());
397  return new ReceiveStep(context->getQoSContext()->ackPolicy->getBlockAckTimeout(blockAckReq));
398  }
399  case 2:
400  return nullptr;
401  default:
402  throw cRuntimeError("Unknown step");
403  }
404 }
virtual QoSContext * getQoSContext() const
Definition: FrameSequenceContext.h:92
virtual IFrameSequenceStep * getLastStep() const
Definition: FrameSequenceContext.h:84
Definition: IFrameSequence.h:50
virtual simtime_t getIfs() const
Definition: FrameSequenceContext.cc:34
Definition: FrameSequenceStep.h:60
virtual std::tuple< MACAddress, SequenceNumber, Tid > computeBlockAckReqParameters(InProgressFrames *inProgressFrames, TxopProcedure *txopProcedure) const =0
IOriginatorQoSAckPolicy * ackPolicy
Definition: FrameSequenceContext.h:47
IOriginatorBlockAckProcedure * blockAckProcedure
Definition: FrameSequenceContext.h:48
Class generated from inet/linklayer/ieee80211/mac/Ieee80211Frame.msg:323 by nedtool.
Definition: Ieee80211Frame_m.h:1013
TxopProcedure * txopProcedure
Definition: FrameSequenceContext.h:50
virtual simtime_t getBlockAckTimeout(Ieee80211BlockAckReq *blockAckReq) const =0
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
int step
Definition: PrimitiveFrameSequences.h:165
virtual Ieee80211BlockAckReq * buildBasicBlockAckReqFrame(const MACAddress &receiverAddress, Tid tid, int startingSequenceNumber) const =0
Definition: FrameSequenceStep.h:26
void inet::ieee80211::BlockAckReqBlockAckFs::startSequence ( FrameSequenceContext context,
int  firstStep 
)
overridevirtual

Implements inet::ieee80211::IFrameSequence.

378 {
379  this->firstStep = firstStep;
380  step = 0;
381 }
int firstStep
Definition: PrimitiveFrameSequences.h:164
int step
Definition: PrimitiveFrameSequences.h:165

Member Data Documentation

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

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