From 997a67657633ea632f3d92352e798e85a9662624 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 24 Jan 2023 23:46:27 +0100 Subject: [PATCH] wifi: Add EMLSR parameters to EHT Configuration --- src/wifi/model/eht/eht-configuration.cc | 24 ++++++++++++++++++++---- src/wifi/model/eht/eht-configuration.h | 5 +++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/eht/eht-configuration.cc b/src/wifi/model/eht/eht-configuration.cc index 9ce431f53..d45e0ec81 100644 --- a/src/wifi/model/eht/eht-configuration.cc +++ b/src/wifi/model/eht/eht-configuration.cc @@ -19,6 +19,7 @@ #include "eht-configuration.h" +#include "ns3/boolean.h" #include "ns3/log.h" namespace ns3 @@ -41,10 +42,25 @@ EhtConfiguration::~EhtConfiguration() TypeId EhtConfiguration::GetTypeId() { - static ns3::TypeId tid = ns3::TypeId("ns3::EhtConfiguration") - .SetParent() - .SetGroupName("Wifi") - .AddConstructor(); + static ns3::TypeId tid = + ns3::TypeId("ns3::EhtConfiguration") + .SetParent() + .SetGroupName("Wifi") + .AddConstructor() + .AddAttribute("EmlsrActivated", + "Whether EMLSR option is activated. If activated, EMLSR mode can be " + "enabled on the EMLSR links by an installed EMLSR Manager.", + TypeId::ATTR_GET | + TypeId::ATTR_CONSTRUCT, // prevent setting after construction + BooleanValue(false), + MakeBooleanAccessor(&EhtConfiguration::m_emlsrActivated), + MakeBooleanChecker()) + .AddAttribute("TransitionTimeout", + "The Transition Timeout (not used by non-AP MLDs). " + "Possible values are 0us or 2^n us, with n=7..16.", + TimeValue(MicroSeconds(0)), + MakeTimeAccessor(&EhtConfiguration::m_transitionTimeout), + MakeTimeChecker(MicroSeconds(0), MicroSeconds(65536))); return tid; } diff --git a/src/wifi/model/eht/eht-configuration.h b/src/wifi/model/eht/eht-configuration.h index 0f27a43b5..773462167 100644 --- a/src/wifi/model/eht/eht-configuration.h +++ b/src/wifi/model/eht/eht-configuration.h @@ -20,6 +20,7 @@ #ifndef EHT_CONFIGURATION_H #define EHT_CONFIGURATION_H +#include "ns3/nstime.h" #include "ns3/object.h" namespace ns3 @@ -44,6 +45,10 @@ class EhtConfiguration : public Object * \return the object TypeId */ static TypeId GetTypeId(); + + private: + bool m_emlsrActivated; //!< whether EMLSR option is activated + Time m_transitionTimeout; //!< Transition timeout }; } // namespace ns3