wifi: (fixes #861) Connect traces to correct Txop object

This commit is contained in:
Stefano Avallone
2023-02-24 11:03:49 +01:00
committed by Stefano Avallone
parent 83de9cdb07
commit fad32cb757

View File

@@ -2593,13 +2593,18 @@ Experiment::Run(const WifiHelper& helper,
MakeCallback(&DisassociationLog));
}
std::string txop =
StaticCast<WifiNetDevice>(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));