wifi: Enable assert in ChannelAccessManager

This commit is contained in:
Stefano Avallone
2023-01-23 14:35:17 +01:00
parent b6350920f4
commit efb34005c8
2 changed files with 5 additions and 3 deletions

View File

@@ -730,8 +730,10 @@ ChannelAccessManager::NotifyCcaBusyStartNow(Time duration,
NS_ASSERT(lastBusyEndIt != m_lastBusyEnd.end());
Time now = Simulator::Now();
lastBusyEndIt->second = now + duration;
// TODO uncomment assert below when PHY passes correct parameters
// NS_ASSERT (per20MhzDurations.size () == m_lastPer20MHzBusyEnd.size ());
NS_ASSERT_MSG(per20MhzDurations.size() == m_lastPer20MHzBusyEnd.size(),
"Size of received vector (" << per20MhzDurations.size()
<< ") differs from the expected size ("
<< m_lastPer20MHzBusyEnd.size() << ")");
for (std::size_t chIdx = 0; chIdx < per20MhzDurations.size(); ++chIdx)
{
if (per20MhzDurations[chIdx].IsStrictlyPositive())

View File

@@ -1381,7 +1381,7 @@ LargestIdlePrimaryChannelTest::RunOne(uint16_t chWidth, WifiChannelListType busy
m_cam,
ccaBusyDuration,
busyChannel,
std::vector<Time>(chWidth / 20, Seconds(0)));
std::vector<Time>(chWidth == 20 ? 0 : chWidth / 20, Seconds(0)));
// During any interval ending within CCA_BUSY period, the idle channel is the
// primary channel contiguous to the busy secondary channel, if the busy channel