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

#include <CtsProcedure.h>

Inheritance diagram for inet::ieee80211::CtsProcedure:
inet::ieee80211::ICtsProcedure

Public Member Functions

virtual void processReceivedRts (Ieee80211RTSFrame *rtsFrame, ICtsPolicy *ctsPolicy, IProcedureCallback *callback) override
 
virtual void processTransmittedCts (Ieee80211CTSFrame *ctsFrame) override
 
- Public Member Functions inherited from inet::ieee80211::ICtsProcedure
virtual ~ICtsProcedure ()
 

Protected Member Functions

virtual Ieee80211CTSFramebuildCts (Ieee80211RTSFrame *rtsFrame) const
 

Protected Attributes

int numReceivedRts = 0
 
int numSentCts = 0
 

Member Function Documentation

Ieee80211CTSFrame * inet::ieee80211::CtsProcedure::buildCts ( Ieee80211RTSFrame rtsFrame) const
protectedvirtual

Referenced by processReceivedRts().

39 {
40  Ieee80211CTSFrame *cts = new Ieee80211CTSFrame("CTS");
41  // The RA field of the CTS frame shall be the value
42  // obtained from the TA field of the to which this
43  // CTS frame is a response.
44  cts->setReceiverAddress(rtsFrame->getTransmitterAddress());
45  return cts;
46 }
void inet::ieee80211::CtsProcedure::processReceivedRts ( Ieee80211RTSFrame rtsFrame,
ICtsPolicy ctsPolicy,
IProcedureCallback callback 
)
overridevirtual

Implements inet::ieee80211::ICtsProcedure.

24 {
26  // A STA that is addressed by an RTS frame shall transmit a CTS frame after a SIFS period
27  // if the NAV at the STA receiving the RTS frame indicates that the medium is idle.
28  if (ctsPolicy->isCtsNeeded(rtsFrame)) {
29  auto ctsFrame = buildCts(rtsFrame);
30  ctsFrame->setDuration(ctsPolicy->computeCtsDurationField(rtsFrame));
31  callback->transmitControlResponseFrame(ctsFrame, rtsFrame);
32  }
33  // If the NAV at the STA receiving the RTS indicates the medium is not idle,
34  // that STA shall not respond to the RTS frame.
35  else ;
36 }
int numReceivedRts
Definition: CtsProcedure.h:32
virtual Ieee80211CTSFrame * buildCts(Ieee80211RTSFrame *rtsFrame) const
Definition: CtsProcedure.cc:38
void inet::ieee80211::CtsProcedure::processTransmittedCts ( Ieee80211CTSFrame ctsFrame)
overridevirtual

Implements inet::ieee80211::ICtsProcedure.

49 {
50  numSentCts++;
51 }
int numSentCts
Definition: CtsProcedure.h:33

Member Data Documentation

int inet::ieee80211::CtsProcedure::numReceivedRts = 0
protected

Referenced by processReceivedRts().

int inet::ieee80211::CtsProcedure::numSentCts = 0
protected

Referenced by processTransmittedCts().


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