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

#include <RecipientBlockAckProcedure.h>

Inheritance diagram for inet::ieee80211::RecipientBlockAckProcedure:
inet::ieee80211::IRecipientBlockAckProcedure

Public Member Functions

virtual void processReceivedBlockAckReq (Ieee80211BlockAckReq *blockAckReq, IRecipientQoSAckPolicy *ackPolicy, IRecipientBlockAckAgreementHandler *blockAckAgreementHandler, IProcedureCallback *callback) override
 
virtual void processTransmittedBlockAck (Ieee80211BlockAck *blockAck) override
 
- Public Member Functions inherited from inet::ieee80211::IRecipientBlockAckProcedure
virtual ~IRecipientBlockAckProcedure ()
 

Protected Member Functions

virtual Ieee80211BlockAckbuildBlockAck (Ieee80211BlockAckReq *blockAckReq, RecipientBlockAckAgreement *agreement)
 

Protected Attributes

int numReceivedBlockAckReq = 0
 
int numSentBlockAck = 0
 

Member Function Documentation

Ieee80211BlockAck * inet::ieee80211::RecipientBlockAckProcedure::buildBlockAck ( Ieee80211BlockAckReq blockAckReq,
RecipientBlockAckAgreement agreement 
)
protectedvirtual

Referenced by processReceivedBlockAckReq().

56 {
57  if (auto basicBlockAckReq = dynamic_cast<Ieee80211BasicBlockAckReq*>(blockAckReq)) {
58  ASSERT(agreement != nullptr);
59  Ieee80211BasicBlockAck *blockAck = new Ieee80211BasicBlockAck("BasicBlockAck");
60  int startingSequenceNumber = basicBlockAckReq->getStartingSequenceNumber();
61  for (SequenceNumber seqNum = startingSequenceNumber; seqNum < startingSequenceNumber + 64; seqNum++) {
62  BitVector &bitmap = blockAck->getBlockAckBitmap(seqNum - startingSequenceNumber);
63  for (FragmentNumber fragNum = 0; fragNum < 16; fragNum++) {
64  bool ackState = agreement->getBlockAckRecord()->getAckState(seqNum, fragNum);
65  bitmap.setBit(fragNum, ackState);
66  }
67  }
68  blockAck->setReceiverAddress(blockAckReq->getTransmitterAddress());
69  blockAck->setCompressedBitmap(false);
70  blockAck->setStartingSequenceNumber(basicBlockAckReq->getStartingSequenceNumber());
71  blockAck->setTidInfo(basicBlockAckReq->getTidInfo());
72  return blockAck;
73  }
74  else
75  throw cRuntimeError("Unsupported Block Ack Request");
76 }
int16_t SequenceNumber
Definition: Ieee80211Defs.h:26
int8_t FragmentNumber
Definition: Ieee80211Defs.h:27
void inet::ieee80211::RecipientBlockAckProcedure::processReceivedBlockAckReq ( Ieee80211BlockAckReq blockAckReq,
IRecipientQoSAckPolicy ackPolicy,
IRecipientBlockAckAgreementHandler blockAckAgreementHandler,
IProcedureCallback callback 
)
overridevirtual

Implements inet::ieee80211::IRecipientBlockAckProcedure.

30 {
32  if (auto basicBlockAckReq = dynamic_cast<Ieee80211BasicBlockAckReq*>(blockAckReq)) {
33  auto agreement = blockAckAgreementHandler->getAgreement(basicBlockAckReq->getTidInfo(), basicBlockAckReq->getTransmitterAddress());
34  if (ackPolicy->isBlockAckNeeded(basicBlockAckReq, agreement)) {
35  auto blockAck = buildBlockAck(basicBlockAckReq, agreement);
36  blockAck->setDuration(ackPolicy->computeBasicBlockAckDurationField(basicBlockAckReq));
37  callback->transmitControlResponseFrame(blockAck, basicBlockAckReq);
38  }
39  }
40  else
41  throw cRuntimeError("Unsupported BlockAckReq");
42 }
int numReceivedBlockAckReq
Definition: RecipientBlockAckProcedure.h:32
virtual Ieee80211BlockAck * buildBlockAck(Ieee80211BlockAckReq *blockAckReq, RecipientBlockAckAgreement *agreement)
Definition: RecipientBlockAckProcedure.cc:55
void inet::ieee80211::RecipientBlockAckProcedure::processTransmittedBlockAck ( Ieee80211BlockAck blockAck)
overridevirtual

Implements inet::ieee80211::IRecipientBlockAckProcedure.

45 {
47 }
int numSentBlockAck
Definition: RecipientBlockAckProcedure.h:33

Member Data Documentation

int inet::ieee80211::RecipientBlockAckProcedure::numReceivedBlockAckReq = 0
protected
int inet::ieee80211::RecipientBlockAckProcedure::numSentBlockAck = 0
protected

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