src/devices/wifi/dcf-manager.h
changeset 5189 8fcdf87a790a
parent 5053 87648432f1ca
child 5192 fb3d57fd97e4
equal deleted inserted replaced
5188:799fdd8fc54a 5189:8fcdf87a790a
    98   void UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound);
    98   void UpdateBackoffSlotsNow (uint32_t nSlots, Time backoffUpdateBound);
    99   void NotifyAccessRequested (void);
    99   void NotifyAccessRequested (void);
   100   void NotifyAccessGranted (void);
   100   void NotifyAccessGranted (void);
   101   void NotifyCollision (void);
   101   void NotifyCollision (void);
   102   void NotifyInternalCollision (void);
   102   void NotifyInternalCollision (void);
       
   103   void NotifyChannelSwitching (void); 
   103 
   104 
   104 
   105 
   105   /**
   106   /**
   106    * Called by DcfManager to notify a DcfState subclass
   107    * Called by DcfManager to notify a DcfState subclass
   107    * that access to the medium is granted and can
   108    * that access to the medium is granted and can
   128    * The subclass is expected to start a new backoff by
   129    * The subclass is expected to start a new backoff by
   129    * calling DcfState::StartBackoffNow and DcfManager::RequestAccess
   130    * calling DcfState::StartBackoffNow and DcfManager::RequestAccess
   130    * is access is still needed.
   131    * is access is still needed.
   131    */
   132    */
   132   virtual void DoNotifyCollision (void) = 0;
   133   virtual void DoNotifyCollision (void) = 0;
       
   134    /**
       
   135    * Called by DcfManager to notify a DcfState subclass
       
   136    * that a channel switching occured.
       
   137    *
       
   138    * The subclass is expected to flush the queue of 
       
   139    * packets.
       
   140    */
       
   141   virtual void DoNotifyChannelSwitching () = 0; 
   133 
   142 
   134   uint32_t m_aifsn;
   143   uint32_t m_aifsn;
   135   uint32_t m_backoffSlots;
   144   uint32_t m_backoffSlots;
   136   // the backoffStart variable is used to keep track of the
   145   // the backoffStart variable is used to keep track of the
   137   // time at which a backoff was started or the time at which
   146   // time at which a backoff was started or the time at which
   246    *
   255    *
   247    * Notify the DCF that a CCA busy period has just started.
   256    * Notify the DCF that a CCA busy period has just started.
   248    */
   257    */
   249   void NotifyMaybeCcaBusyStartNow (Time duration);
   258   void NotifyMaybeCcaBusyStartNow (Time duration);
   250   /**
   259   /**
       
   260    * \param duration expected duration of channel switching period
       
   261    *
       
   262    * Notify the DCF that a channel switching period has just started.
       
   263    */
       
   264   void NotifySwitchingStartNow (Time duration); 
       
   265   /**
   251    * \param duration the value of the received NAV.
   266    * \param duration the value of the received NAV.
   252    *
   267    *
   253    * Called at end of rx
   268    * Called at end of rx
   254    */
   269    */
   255   void NotifyNavResetNow (Time duration);
   270   void NotifyNavResetNow (Time duration);
   267   void UpdateBackoff (void);
   282   void UpdateBackoff (void);
   268   Time MostRecent (Time a, Time b) const;
   283   Time MostRecent (Time a, Time b) const;
   269   Time MostRecent (Time a, Time b, Time c) const;
   284   Time MostRecent (Time a, Time b, Time c) const;
   270   Time MostRecent (Time a, Time b, Time c, Time d) const;
   285   Time MostRecent (Time a, Time b, Time c, Time d) const;
   271   Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f) const;
   286   Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f) const;
       
   287   Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f, Time g) const; 
   272   /**
   288   /**
   273    * Access will never be granted to the medium _before_
   289    * Access will never be granted to the medium _before_
   274    * the time returned by this method.
   290    * the time returned by this method.
   275    * 
   291    * 
   276    * \returns the absolute time at which access could start to 
   292    * \returns the absolute time at which access could start to 
   297   Time m_lastRxEnd;
   313   Time m_lastRxEnd;
   298   Time m_lastTxStart;
   314   Time m_lastTxStart;
   299   Time m_lastTxDuration;
   315   Time m_lastTxDuration;
   300   Time m_lastBusyStart;
   316   Time m_lastBusyStart;
   301   Time m_lastBusyDuration;
   317   Time m_lastBusyDuration;
       
   318   Time m_lastSwitchingStart; 
       
   319   Time m_lastSwitchingDuration; 
   302   bool m_rxing;
   320   bool m_rxing;
   303   bool m_sleeping;
   321   bool m_sleeping;
   304   Time m_eifsNoDifs;
   322   Time m_eifsNoDifs;
   305   EventId m_accessTimeout;
   323   EventId m_accessTimeout;
   306   Time m_slotTime;
   324   Time m_slotTime;