From fad32cb75727bd1099bb38db6f3880a2683e5ece Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 24 Feb 2023 11:03:49 +0100 Subject: [PATCH] wifi: (fixes #861) Connect traces to correct Txop object --- src/wifi/examples/wifi-bianchi.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/wifi/examples/wifi-bianchi.cc b/src/wifi/examples/wifi-bianchi.cc index f444318db..cef612a50 100644 --- a/src/wifi/examples/wifi-bianchi.cc +++ b/src/wifi/examples/wifi-bianchi.cc @@ -2593,13 +2593,18 @@ Experiment::Run(const WifiHelper& helper, MakeCallback(&DisassociationLog)); } + std::string txop = + StaticCast(wifiNodes.Get(0)->GetDevice(0))->GetMac()->GetQosSupported() + ? "BE_Txop" + : "Txop"; // Trace CW evolution - Config::Connect("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/Txop/CwTrace", + Config::Connect("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/" + txop + + "/CwTrace", MakeCallback(&CwTrace)); // Trace backoff evolution - Config::Connect( - "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/Txop/BackoffTrace", - MakeCallback(&BackoffTrace)); + Config::Connect("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/" + txop + + "/BackoffTrace", + MakeCallback(&BackoffTrace)); // Trace PHY Tx start events Config::Connect("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxBegin", MakeCallback(&PhyTxTrace));