diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index 00d514fbb..cd48dd619 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -290,6 +290,13 @@ WifiMac::GetTypeId() UintegerValue(0), MakeUintegerAccessor(&WifiMac::SetBkBlockAckInactivityTimeout), MakeUintegerChecker()) + .AddAttribute("RobustAVStreamingSupported", + "Whether or not Robust Audio Video Streaming is supported (only allowed " + "for AP STAs or non-AP that are HT capable).", + BooleanValue(false), + MakeBooleanAccessor(&WifiMac::SetRobustAVStreamingSupported, + &WifiMac::GetRobustAVStreamingSupported), + MakeBooleanChecker()) .AddTraceSource( "MacTx", "A packet has been received by the WifiNetDevice and is about to be enqueued; " @@ -2562,4 +2569,19 @@ WifiMac::GetMaxAmsduSize(AcIndex ac) const return maxSize; } +void +WifiMac::SetRobustAVStreamingSupported(bool enable) +{ + NS_LOG_FUNCTION(this << enable); + m_robustAVStreamingSupported = enable; +} + +bool +WifiMac::GetRobustAVStreamingSupported() const +{ + NS_ASSERT_MSG(!m_robustAVStreamingSupported || GetDevice()->GetHtConfiguration(), + "Robust AV Streaming requires STA to be HT-capable"); + return m_robustAVStreamingSupported; +} + } // namespace ns3 diff --git a/src/wifi/model/wifi-mac.h b/src/wifi/model/wifi-mac.h index 77a2a5393..6f22bac15 100644 --- a/src/wifi/model/wifi-mac.h +++ b/src/wifi/model/wifi-mac.h @@ -649,6 +649,19 @@ class WifiMac : public Object */ bool GetEhtSupported(const Mac48Address& address) const; + /** + * Enable or disable Robust AV Streaming support for the device. + * + * @param enable whether Robust AV Streaming is supported + */ + void SetRobustAVStreamingSupported(bool enable); + /** + * Return whether the device supports Robust AV Streaming. + * + * @return true if Robust AV Streaming is supported, false otherwise + */ + bool GetRobustAVStreamingSupported() const; + /** * Return the maximum A-MPDU size of the given Access Category. * @@ -1233,6 +1246,8 @@ class WifiMac : public Object UniformRandomBitGenerator m_shuffleLinkIdsGen; //!< random number generator to shuffle link IDs + bool m_robustAVStreamingSupported; ///< flag whether robust AV streaming is supported + /// @brief DL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address) std::unordered_map m_dlTidLinkMappings; /// @brief UL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address)