src/devices/wifi/wifi-phy.cc
changeset 1992 5ff1101cb843
parent 1988 210701141b08
child 1999 9c279e6ebb20
equal deleted inserted replaced
1991:6527b3e26b86 1992:5ff1101cb843
    86       m_endTime (m_startTime + duration),
    86       m_endTime (m_startTime + duration),
    87       m_rxPowerW (rxPower),
    87       m_rxPowerW (rxPower),
    88       m_refCount (1)
    88       m_refCount (1)
    89   {}
    89   {}
    90   ~RxEvent ()
    90   ~RxEvent ()
    91   {}
    91   {
       
    92     NS_ASSERT (m_refCount == 0);
       
    93   }
    92   
    94   
    93   void Ref (void) const {
    95   void Ref (void) const {
    94     m_refCount++;
    96     m_refCount++;
    95   }
    97   }
    96   void Unref (void) const {
    98   void Unref (void) const {
   275         goto maybeCcaBusy;
   277         goto maybeCcaBusy;
   276       }
   278       }
   277     break;
   279     break;
   278   }
   280   }
   279 
   281 
   280   event->Unref ();
       
   281   return;
   282   return;
   282 
   283 
   283  maybeCcaBusy:
   284  maybeCcaBusy:
   284 
   285 
   285   if (rxPowerW > m_edThresholdW) 
   286   if (rxPowerW > m_edThresholdW) 
   309           SwitchMaybeToCcaBusy (delta);
   310           SwitchMaybeToCcaBusy (delta);
   310           NotifyCcaBusyStart (delta);
   311           NotifyCcaBusyStart (delta);
   311         }
   312         }
   312     }
   313     }
   313 
   314 
   314   event->Unref ();
       
   315 }
   315 }
   316 void 
   316 void 
   317 WifiPhy::SendPacket (Packet const packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower)
   317 WifiPhy::SendPacket (Packet const packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower)
   318 {
   318 {
   319   /* Transmission can happen if:
   319   /* Transmission can happen if:
  1171       m_endSyncLogger (false);
  1171       m_endSyncLogger (false);
  1172       NotifySyncEndError ();
  1172       NotifySyncEndError ();
  1173       SwitchFromSync ();
  1173       SwitchFromSync ();
  1174       m_syncErrorCallback (packet, snr);
  1174       m_syncErrorCallback (packet, snr);
  1175     }
  1175     }
  1176   event->Unref ();
       
  1177 }
  1176 }
  1178 
  1177 
  1179 
  1178 
  1180 
  1179 
  1181 
  1180