From bb0d4f694e91241ef02a2ef4706ecc301032f711 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 6 Jun 2023 19:35:07 +0200 Subject: [PATCH] wifi: Make some EmlsrManager attributes not modifiable after construction --- src/wifi/model/eht/emlsr-manager.cc | 5 ++++- src/wifi/model/eht/emlsr-manager.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index 178f792fb..0649b904d 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -59,12 +59,15 @@ EmlsrManager::GetTypeId() .AddAttribute( "MainPhyId", "The ID of the main PHY (position in the vector of PHYs held by " - "WifiNetDevice). This attribute cannot be set after initialization.", + "WifiNetDevice). This attribute cannot be set after construction.", + TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT, // prevent setting after construction UintegerValue(0), MakeUintegerAccessor(&EmlsrManager::SetMainPhyId, &EmlsrManager::GetMainPhyId), MakeUintegerChecker()) .AddAttribute("AuxPhyChannelWidth", "The maximum channel width (MHz) supported by Aux PHYs", + TypeId::ATTR_GET | + TypeId::ATTR_CONSTRUCT, // prevent setting after construction UintegerValue(20), MakeUintegerAccessor(&EmlsrManager::m_auxPhyMaxWidth), MakeUintegerChecker(20, 160)) diff --git a/src/wifi/model/eht/emlsr-manager.h b/src/wifi/model/eht/emlsr-manager.h index 2bec469ce..82ae1d995 100644 --- a/src/wifi/model/eht/emlsr-manager.h +++ b/src/wifi/model/eht/emlsr-manager.h @@ -73,14 +73,6 @@ class EmlsrManager : public Object */ std::optional