From f8a20c404f2e4841f1d460185f2c2c3930dd3742 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 16 May 2024 16:25:14 +0200 Subject: [PATCH] wifi: TypeId must be defined before setting ObjectFactory attributes --- src/wifi/helper/wifi-mac-helper.cc | 4 ++++ src/wifi/model/wifi-standards.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wifi/helper/wifi-mac-helper.cc b/src/wifi/helper/wifi-mac-helper.cc index bdb6abf75..5dd6812ee 100644 --- a/src/wifi/helper/wifi-mac-helper.cc +++ b/src/wifi/helper/wifi-mac-helper.cc @@ -50,6 +50,10 @@ WifiMacHelper::WifiMacHelper() it->second.SetTypeId("ns3::QosTxop"); } m_channelAccessManager.SetTypeId("ns3::ChannelAccessManager"); + // Setting FEM attributes requires setting a TypeId first. We initialize the TypeId to the FEM + // of the latest standard, in order to allow users to set the attributes of all the FEMs. The + // Create method will set the requested standard before creating the FEM(s). + m_frameExchangeManager.SetTypeId(GetFrameExchangeManagerTypeIdName(WIFI_STANDARD_COUNT, true)); m_assocManager.SetTypeId("ns3::WifiDefaultAssocManager"); m_queueScheduler.SetTypeId("ns3::FcfsWifiQueueScheduler"); m_protectionManager.SetTypeId("ns3::WifiDefaultProtectionManager"); diff --git a/src/wifi/model/wifi-standards.h b/src/wifi/model/wifi-standards.h index e5de37157..60f5b47ea 100644 --- a/src/wifi/model/wifi-standards.h +++ b/src/wifi/model/wifi-standards.h @@ -45,7 +45,8 @@ enum WifiStandard WIFI_STANDARD_80211ac, WIFI_STANDARD_80211ad, WIFI_STANDARD_80211ax, - WIFI_STANDARD_80211be + WIFI_STANDARD_80211be, + WIFI_STANDARD_COUNT }; /**