wifi: WifiAckManager and WifiProtectionManager are configured with their link ID
This commit is contained in:
committed by
Stefano Avallone
parent
4d61d67a7d
commit
ab67a74f22
@@ -65,10 +65,12 @@ WifiMacHelper::Create (Ptr<WifiNetDevice> device, WifiStandard standard) const
|
||||
{
|
||||
Ptr<WifiProtectionManager> protectionManager = m_protectionManager.Create<WifiProtectionManager> ();
|
||||
protectionManager->SetWifiMac (mac);
|
||||
protectionManager->SetLinkId (SINGLE_LINK_OP_ID);
|
||||
fem->SetProtectionManager (protectionManager);
|
||||
|
||||
Ptr<WifiAckManager> ackManager = m_ackManager.Create<WifiAckManager> ();
|
||||
ackManager->SetWifiMac (mac);
|
||||
ackManager->SetLinkId (SINGLE_LINK_OP_ID);
|
||||
fem->SetAckManager (ackManager);
|
||||
|
||||
// create and install the Multi User Scheduler if this is an HE AP
|
||||
|
||||
@@ -40,6 +40,12 @@ WifiAckManager::GetTypeId (void)
|
||||
return tid;
|
||||
}
|
||||
|
||||
WifiAckManager::WifiAckManager ()
|
||||
: m_linkId (0)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
|
||||
WifiAckManager::~WifiAckManager ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
@@ -60,6 +66,13 @@ WifiAckManager::SetWifiMac (Ptr<WifiMac> mac)
|
||||
m_mac = mac;
|
||||
}
|
||||
|
||||
void
|
||||
WifiAckManager::SetLinkId (uint8_t linkId)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << +linkId);
|
||||
m_linkId = linkId;
|
||||
}
|
||||
|
||||
void
|
||||
WifiAckManager::SetQosAckPolicy (Ptr<WifiMacQueueItem> item, const WifiAcknowledgment* acknowledgment)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
WifiAckManager ();
|
||||
virtual ~WifiAckManager ();
|
||||
|
||||
/**
|
||||
@@ -55,6 +56,12 @@ public:
|
||||
* \param mac a pointer to the MAC
|
||||
*/
|
||||
void SetWifiMac (Ptr<WifiMac> mac);
|
||||
/**
|
||||
* Set the ID of the link this Acknowledgment Manager is associated with.
|
||||
*
|
||||
* \param linkId the ID of the link this Acknowledgment Manager is associated with
|
||||
*/
|
||||
void SetLinkId (uint8_t linkId);
|
||||
|
||||
/**
|
||||
* Set the QoS Ack policy for the given MPDU, which must be a QoS data frame.
|
||||
@@ -102,6 +109,7 @@ protected:
|
||||
void DoDispose (void) override;
|
||||
|
||||
Ptr<WifiMac> m_mac; //!< MAC which is using this Acknowledgment Manager
|
||||
uint8_t m_linkId; //!< ID of the link this Acknowledgment Manager is operating on
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ WifiDefaultAckManager::TryUlMuTransmission (Ptr<const WifiMacQueueItem> mpdu,
|
||||
Ptr<ApWifiMac> apMac = DynamicCast<ApWifiMac> (m_mac);
|
||||
NS_ABORT_MSG_IF (apMac == nullptr, "HE APs only can send Trigger Frames");
|
||||
|
||||
Ptr<HeFrameExchangeManager> heFem = DynamicCast<HeFrameExchangeManager> (m_mac->GetFrameExchangeManager ());
|
||||
auto heFem = DynamicCast<HeFrameExchangeManager> (m_mac->GetFrameExchangeManager (m_linkId));
|
||||
NS_ABORT_MSG_IF (heFem == nullptr, "HE APs only can send Trigger Frames");
|
||||
|
||||
CtrlTriggerHeader trigger;
|
||||
|
||||
@@ -39,6 +39,12 @@ WifiProtectionManager::GetTypeId (void)
|
||||
return tid;
|
||||
}
|
||||
|
||||
WifiProtectionManager::WifiProtectionManager ()
|
||||
: m_linkId (0)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
|
||||
WifiProtectionManager::~WifiProtectionManager ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
@@ -59,4 +65,11 @@ WifiProtectionManager::SetWifiMac (Ptr<WifiMac> mac)
|
||||
m_mac = mac;
|
||||
}
|
||||
|
||||
void
|
||||
WifiProtectionManager::SetLinkId (uint8_t linkId)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << +linkId);
|
||||
m_linkId = linkId;
|
||||
}
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId (void);
|
||||
WifiProtectionManager ();
|
||||
virtual ~WifiProtectionManager ();
|
||||
|
||||
/**
|
||||
@@ -54,6 +55,12 @@ public:
|
||||
* \param mac a pointer to the MAC
|
||||
*/
|
||||
void SetWifiMac (Ptr<WifiMac> mac);
|
||||
/**
|
||||
* Set the ID of the link this Protection Manager is associated with.
|
||||
*
|
||||
* \param linkId the ID of the link this Protection Manager is associated with
|
||||
*/
|
||||
void SetLinkId (uint8_t linkId);
|
||||
|
||||
/**
|
||||
* Determine the protection method to use if the given MPDU is added to the current
|
||||
@@ -85,6 +92,7 @@ protected:
|
||||
virtual void DoDispose (void);
|
||||
|
||||
Ptr<WifiMac> m_mac; //!< MAC which is using this Protection Manager
|
||||
uint8_t m_linkId; //!< ID of the link this Protection Manager is operating on
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user