wifi: Add an EMSLR manager method to check if channel access is expected soon
This commit is contained in:
@@ -934,6 +934,28 @@ EmlsrManager::MediumSyncDelayNTxopsExceeded(uint8_t linkId)
|
||||
return timerIt->second.msdNTxopsLeft == 0;
|
||||
}
|
||||
|
||||
bool
|
||||
EmlsrManager::GetExpectedAccessWithinDelay(uint8_t linkId, const Time& delay) const
|
||||
{
|
||||
const auto deadline = Simulator::Now() + delay;
|
||||
for (const auto& [acIndex, ac] : wifiAcList)
|
||||
{
|
||||
if (auto edca = m_staMac->GetQosTxop(acIndex); edca->HasFramesToTransmit(linkId))
|
||||
{
|
||||
const auto backoffEnd =
|
||||
m_staMac->GetChannelAccessManager(linkId)->GetBackoffEndFor(edca);
|
||||
|
||||
if (backoffEnd <= deadline)
|
||||
{
|
||||
NS_LOG_DEBUG("Backoff end for " << acIndex << " on link " << +linkId << ": "
|
||||
<< backoffEnd.As(Time::US));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
MgtEmlOmn
|
||||
EmlsrManager::GetEmlOmn()
|
||||
{
|
||||
|
||||
@@ -488,6 +488,17 @@ class EmlsrManager : public Object
|
||||
*/
|
||||
void CancelAllSleepEvents();
|
||||
|
||||
/**
|
||||
* Get whether channel access is expected to be granted on the given link within the given
|
||||
* delay to an Access Category that has traffic to send on the given link.
|
||||
*
|
||||
* @param linkId the ID of the given link
|
||||
* @param delay the given delay
|
||||
* @return whether channel access is expected to be granted on the given link within the given
|
||||
* delay
|
||||
*/
|
||||
bool GetExpectedAccessWithinDelay(uint8_t linkId, const Time& delay) const;
|
||||
|
||||
Time m_emlsrPaddingDelay; //!< EMLSR Padding delay
|
||||
Time m_emlsrTransitionDelay; //!< EMLSR Transition delay
|
||||
uint8_t m_mainPhyId; //!< ID of main PHY (position in the vector of PHYs held by WifiNetDevice)
|
||||
|
||||
Reference in New Issue
Block a user