wifi: Add an attribute to StaWifiMac to disable channel scanning

This commit is contained in:
Stefano Avallone
2025-06-24 12:07:23 +02:00
parent 09474c4456
commit d58edfde6a
3 changed files with 13 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ This file is a best-effort approach to solving this issue; we will do our best b
* (wifi) Added a new `EarlyTxopEndDetect` attribute to `EhtFrameExchangeManager` to control whether the Duration/ID value of the frame being transmitted or received by a device shall be used to early detect the end of an ongoing TXOP (held by another device).
* (spectrum) Added the base `WraparoundModel`, which is retrieved from the associated objects of a spectrum channel, and then used to wraparound the transmitter mobility model during transmissions.
* (spectrum) Added the `HexagonalWraparoundModel`, which implements the wraparound for a hexagonal cell deployment, typical of cellular networks.
* (wifi) Added a new `DisableScanning` attribute to `StaWifiMac` to disable channel scanning; it can be useful to set this attribute to false when a static setup is performed.
### Changes to existing API

View File

@@ -74,6 +74,12 @@ StaWifiMac::GetTypeId()
UintegerValue(10),
MakeUintegerAccessor(&StaWifiMac::m_maxMissedBeacons),
MakeUintegerChecker<uint32_t>())
.AddAttribute("EnableScanning",
"If false, STA does not perform channel scanning. This may be useful in "
"case of static configuration via the static setup helper.",
BooleanValue(true),
MakeBooleanAccessor(&StaWifiMac::m_enableScanning),
MakeBooleanChecker())
.AddAttribute(
"ActiveProbing",
"If true, we send probe requests. If false, we don't."
@@ -823,6 +829,11 @@ void
StaWifiMac::StartScanning()
{
NS_LOG_FUNCTION(this);
if (!m_enableScanning)
{
NS_LOG_DEBUG("Scanning disabled");
return;
}
SetState(SCANNING);
NS_ASSERT(m_assocManager);

View File

@@ -662,6 +662,7 @@ class StaWifiMac : public WifiMac
uint32_t m_maxMissedBeacons; ///< maximum missed beacons
EventId m_beaconWatchdog; //!< beacon watchdog
Time m_beaconWatchdogEnd{0}; //!< beacon watchdog end
bool m_enableScanning; //!< enable channel scanning
bool m_activeProbing; ///< active probing
Ptr<RandomVariableStream> m_probeDelay; ///< RandomVariable used to randomize the time
///< of the first Probe Response on each channel