src/devices/wifi/nqsta-wifi-mac.cc
changeset 6065 0f012e7d9128
parent 5819 514ec98954ab
child 6068 a2127017ecb4
equal deleted inserted replaced
6064:ddec96840ebd 6065:0f012e7d9128
    22 #include "ns3/simulator.h"
    22 #include "ns3/simulator.h"
    23 #include "ns3/assert.h"
    23 #include "ns3/assert.h"
    24 #include "ns3/log.h"
    24 #include "ns3/log.h"
    25 #include "ns3/node.h"
    25 #include "ns3/node.h"
    26 #include "ns3/uinteger.h"
    26 #include "ns3/uinteger.h"
       
    27 #include "ns3/boolean.h"
    27 #include "ns3/trace-source-accessor.h"
    28 #include "ns3/trace-source-accessor.h"
    28 
    29 
    29 #include "nqsta-wifi-mac.h"
    30 #include "nqsta-wifi-mac.h"
    30 #include "wifi-mac-header.h"
    31 #include "wifi-mac-header.h"
    31 #include "mgt-headers.h"
    32 #include "mgt-headers.h"
   607           if (assocResp.GetStatusCode ().IsSuccess ()) 
   608           if (assocResp.GetStatusCode ().IsSuccess ()) 
   608             {
   609             {
   609               SetState (ASSOCIATED);
   610               SetState (ASSOCIATED);
   610               NS_LOG_DEBUG ("assoc completed"); 
   611               NS_LOG_DEBUG ("assoc completed"); 
   611               SupportedRates rates = assocResp.GetSupportedRates ();
   612               SupportedRates rates = assocResp.GetSupportedRates ();
   612               WifiRemoteStation *ap = m_stationManager->Lookup (hdr->GetAddr2 ());
       
   613               for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
   613               for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
   614                 {
   614                 {
   615                   WifiMode mode = m_phy->GetMode (i);
   615                   WifiMode mode = m_phy->GetMode (i);
   616                   if (rates.IsSupportedRate (mode.GetDataRate ()))
   616                   if (rates.IsSupportedRate (mode.GetDataRate ()))
   617                     {
   617                     {
   618                       ap->AddSupportedMode (mode);
   618                       m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
   619                       if (rates.IsBasicRate (mode.GetDataRate ()))
   619                       if (rates.IsBasicRate (mode.GetDataRate ()))
   620                         {
   620                         {
   621                           m_stationManager->AddBasicMode (mode);
   621                           m_stationManager->AddBasicMode (mode);
   622                         }
   622                         }
   623                     }
   623                     }