wifi: Set ChannelSettings after thrown exception in WifiPhy configuration example

This commit is contained in:
Sébastien Deronne
2023-05-22 21:00:29 +02:00
parent 426e6a4ba9
commit 9e4f74dc71

View File

@@ -454,7 +454,6 @@ main(int argc, char* argv[])
NS_ASSERT(phySta->GetChannelWidth() == 20);
NS_ASSERT(phySta->GetFrequency() == 5180);
NS_ASSERT(exceptionThrown);
phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
exceptionThrown = false;
try
{
@@ -464,6 +463,7 @@ main(int argc, char* argv[])
{
exceptionThrown = true;
}
phySta->SetAttribute("ChannelSettings", StringValue("{36, 0, BAND_5GHZ, 0}"));
// We expect channel number to be 36 and an exception to be thrown
NS_ASSERT(phySta->GetChannelNumber() == 36);
NS_ASSERT(phySta->GetChannelWidth() == 20);