Sync event must be properly canceled upon tx during sync.

This commit is contained in:
Federico Maguolo
2008-02-26 01:23:27 +01:00
parent 10d2a5b770
commit 0d49574056

View File

@@ -356,10 +356,6 @@ WifiPhy::SendPacket (Ptr<const Packet> packet, WifiMode txMode, WifiPreamble pre
*/
NS_ASSERT (!IsStateTx ());
if (IsStateSync ()) {
m_endSyncEvent.Cancel ();
}
Time txDuration = CalculateTxDuration (packet->GetSize (), txMode, preamble);
NotifyTxStart (txDuration);
SwitchToTx (txDuration);
@@ -696,6 +692,8 @@ WifiPhy::SwitchToTx (Time txDuration)
*/
m_syncing = false;
m_stateLogger (m_startSync, now - m_startSync, WifiPhy::SYNC);
m_endSyncEvent.Cancel ();
m_endSync = now;
break;
case WifiPhy::CCA_BUSY: {
Time ccaStart = Max (m_endSync, m_endTx);