wifi: Move operations to be done by PHY at the end of TX in a separate function

This commit is contained in:
Sébastien Deronne
2024-02-21 12:29:34 +01:00
committed by Sébastien Deronne
parent fb358034cd
commit 99a6477d5e
2 changed files with 16 additions and 4 deletions

View File

@@ -1842,17 +1842,23 @@ WifiPhy::Send(WifiConstPsduMap psdus, const WifiTxVector& txVector)
}
m_endTxEvent =
Simulator::Schedule(txDuration, &WifiPhy::NotifyTxEnd, this, psdus); // TODO: fix for MU
Simulator::Schedule(txDuration, &WifiPhy::TxDone, this, psdus); // TODO: fix for MU
StartTx(ppdu);
ppdu->ResetTxVector();
m_channelAccessRequested = false;
m_powerRestricted = false;
}
Simulator::Schedule(txDuration, &WifiPhy::Reset, this);
Simulator::Schedule(txDuration, &WifiPhy::SwitchMaybeToCcaBusy, this, nullptr);
void
WifiPhy::TxDone(const WifiConstPsduMap& psdus)
{
NS_LOG_FUNCTION(this << psdus);
NotifyTxEnd(psdus);
Reset();
// we might have received signals during TX
SwitchMaybeToCcaBusy();
}
uint64_t

View File

@@ -1389,6 +1389,12 @@ class WifiPhy : public Object
*/
void AbortCurrentReception(WifiPhyRxfailureReason reason);
/**
* Callback function when a transmission is completed
* \param psdus the PSDUs that have been sent
*/
void TxDone(const WifiConstPsduMap& psdus);
/**
* Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
*