A Discrete-Event Network Simulator
API
WifiEhtCapabilitiesIeTest Class Reference

Test serialization and deserialization of EHT capabilities IE. More...

+ Inheritance diagram for WifiEhtCapabilitiesIeTest:
+ Collaboration diagram for WifiEhtCapabilitiesIeTest:

Public Member Functions

 WifiEhtCapabilitiesIeTest (bool is2_4Ghz, uint16_t channelWidth)
 Constructor. More...
 
 ~WifiEhtCapabilitiesIeTest () override=default
 
void CheckEhtMacCapabilitiesInformation (const Buffer &buffer, uint8_t expectedValueFirstByte)
 Check the content of the EHT MAC Capabilities Information subfield. More...
 
void CheckEhtPhyCapabilitiesInformation (const Buffer &buffer, uint8_t expectedValueSixthByte)
 Check the content of the EHT PHY Capabilities Information subfield. More...
 
void CheckSerializedByte (const Buffer &buffer, uint32_t position, uint8_t value)
 Check that the given buffer contains the given value at the given position. More...
 
void CheckSupportedEhtMcsAndNssSet (const Buffer &buffer, uint8_t maxSupportedMcs)
 Check the content of the Supported EHT-MCS And NSS Set subfield. More...
 
EhtCapabilities GetEhtCapabilities (uint16_t maxMpduLength, uint32_t maxAmpduSize, uint8_t maxSupportedMcs) const
 Generate the EHT capabilities IE. More...
 
HeCapabilities GetHeCapabilities () const
 Generate the HE capabilities IE. More...
 
Buffer SerializeIntoBuffer (const EhtCapabilities &ehtCapabilities)
 Serialize the EHT capabilities in a buffer. More...
 
- Public Member Functions inherited from ns3::HeaderSerializationTestCase
template<typename T , typename... Args>
void TestHeaderSerialization (const T &hdr, Args &&... args)
 Serialize the given header in a buffer, then create a new header by deserializing from the buffer and serialize the new header into a new buffer. More...
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase. More...
 

Private Attributes

uint16_t m_channelWidth
 Supported channel width by the PHY (in MHz) More...
 
bool m_is2_4Ghz
 whether the PHY is operating in 2.4 GHz More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Protected Member Functions inherited from ns3::HeaderSerializationTestCase
 HeaderSerializationTestCase (std::string name)
 Constructor. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase. More...
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Detailed Description

Test serialization and deserialization of EHT capabilities IE.

Definition at line 776 of file wifi-eht-info-elems-test.cc.

Constructor & Destructor Documentation

◆ WifiEhtCapabilitiesIeTest()

WifiEhtCapabilitiesIeTest::WifiEhtCapabilitiesIeTest ( bool  is2_4Ghz,
uint16_t  channelWidth 
)

Constructor.

Parameters
is2_4Ghzwhether the PHY is operating in 2.4 GHz
channelWidththe supported channel width in MHz

Definition at line 854 of file wifi-eht-info-elems-test.cc.

◆ ~WifiEhtCapabilitiesIeTest()

WifiEhtCapabilitiesIeTest::~WifiEhtCapabilitiesIeTest ( )
overridedefault

Member Function Documentation

◆ CheckEhtMacCapabilitiesInformation()

void WifiEhtCapabilitiesIeTest::CheckEhtMacCapabilitiesInformation ( const Buffer buffer,
uint8_t  expectedValueFirstByte 
)

Check the content of the EHT MAC Capabilities Information subfield.

Parameters
bufferthe buffer containing the serialized EHT capabilities
expectedValueFirstBytethe expected value for the first byte

Definition at line 982 of file wifi-eht-info-elems-test.cc.

References CheckSerializedByte().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckEhtPhyCapabilitiesInformation()

void WifiEhtCapabilitiesIeTest::CheckEhtPhyCapabilitiesInformation ( const Buffer buffer,
uint8_t  expectedValueSixthByte 
)

Check the content of the EHT PHY Capabilities Information subfield.

Parameters
bufferthe buffer containing the serialized EHT capabilities
expectedValueSixthBytethe expected value for the sixth byte

Definition at line 990 of file wifi-eht-info-elems-test.cc.

References CheckSerializedByte(), and m_channelWidth.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckSerializedByte()

void WifiEhtCapabilitiesIeTest::CheckSerializedByte ( const Buffer buffer,
uint32_t  position,
uint8_t  value 
)

Check that the given buffer contains the given value at the given position.

Parameters
bufferthe given buffer
positionthe given position (starting at 0)
valuethe given value

Definition at line 971 of file wifi-eht-info-elems-test.cc.

References ns3::Buffer::Begin(), ns3::Buffer::Iterator::Next(), NS_TEST_EXPECT_MSG_EQ, ns3::Buffer::Iterator::ReadU8(), and second::value.

Referenced by CheckEhtMacCapabilitiesInformation(), CheckEhtPhyCapabilitiesInformation(), and CheckSupportedEhtMcsAndNssSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckSupportedEhtMcsAndNssSet()

void WifiEhtCapabilitiesIeTest::CheckSupportedEhtMcsAndNssSet ( const Buffer buffer,
uint8_t  maxSupportedMcs 
)

Check the content of the Supported EHT-MCS And NSS Set subfield.

Parameters
maxSupportedMcsthe maximum EHT MCS supported by the PHY
bufferthe buffer containing the serialized EHT capabilities

Definition at line 1005 of file wifi-eht-info-elems-test.cc.

References CheckSerializedByte(), and m_channelWidth.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRun()

◆ GetEhtCapabilities()

EhtCapabilities WifiEhtCapabilitiesIeTest::GetEhtCapabilities ( uint16_t  maxMpduLength,
uint32_t  maxAmpduSize,
uint8_t  maxSupportedMcs 
) const

Generate the EHT capabilities IE.

Parameters
maxMpduLengththe maximum MPDU length in bytes
maxAmpduSizethe maximum A-MPDU size in bytes
maxSupportedMcsthe maximum EHT MCS supported by the PHY
Returns
the generated EHT capabilities IE

Definition at line 883 of file wifi-eht-info-elems-test.cc.

References m_channelWidth, m_is2_4Ghz, ns3::EhtCapabilities::m_phyCapabilities, max, min, ns3::EhtCapabilities::SetMaxAmpduLength(), ns3::EhtCapabilities::SetMaxMpduLength(), ns3::EhtCapabilities::SetSupportedRxEhtMcsAndNss(), ns3::EhtCapabilities::SetSupportedTxEhtMcsAndNss(), ns3::EhtPhyCapabilities::support320MhzIn6Ghz, ns3::EhtPhyCapabilities::supportRx1024And4096QamForRuSmallerThan242Tones, and ns3::EhtPhyCapabilities::supportTx1024And4096QamForRuSmallerThan242Tones.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetHeCapabilities()

HeCapabilities WifiEhtCapabilitiesIeTest::GetHeCapabilities ( ) const

Generate the HE capabilities IE.

Returns
the generated HE capabilities IE

Definition at line 862 of file wifi-eht-info-elems-test.cc.

References m_channelWidth, m_is2_4Ghz, and ns3::HeCapabilities::SetChannelWidthSet().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SerializeIntoBuffer()

Buffer WifiEhtCapabilitiesIeTest::SerializeIntoBuffer ( const EhtCapabilities ehtCapabilities)

Serialize the EHT capabilities in a buffer.

Parameters
ehtCapabilitiesthe EHT capabilities
Returns
the buffer in which the EHT capabilities has been serialized

Definition at line 962 of file wifi-eht-info-elems-test.cc.

References ns3::Buffer::AddAtStart(), ns3::Buffer::Begin(), ns3::WifiInformationElement::GetSerializedSize(), and ns3::WifiInformationElement::Serialize().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelWidth

uint16_t WifiEhtCapabilitiesIeTest::m_channelWidth
private

Supported channel width by the PHY (in MHz)

Definition at line 851 of file wifi-eht-info-elems-test.cc.

Referenced by CheckEhtPhyCapabilitiesInformation(), CheckSupportedEhtMcsAndNssSet(), DoRun(), GetEhtCapabilities(), and GetHeCapabilities().

◆ m_is2_4Ghz

bool WifiEhtCapabilitiesIeTest::m_is2_4Ghz
private

whether the PHY is operating in 2.4 GHz

Definition at line 850 of file wifi-eht-info-elems-test.cc.

Referenced by DoRun(), GetEhtCapabilities(), and GetHeCapabilities().


The documentation for this class was generated from the following file: