Hi all,
Then I try to wrap it in a method that I can schedule at t=10. However, what I have tried did not work, since I have checked that the cw attribute has not been changed from the config file. However, when I tried to do it without the scheduling, it works (the value has been changed). So it seems that the problem from the way I scheduled the method. any help please?
void chaan( Ptr<Node> node, uint32_t minCw, uint32_t maxCw )
{
///// changing contention window
//uint32_t minCw = 1;
//uint32_t maxCw = minCw;
//Ptr<Node> node = wifiStaNodes.Get(0);
//Ptr<Node> node = wifiStaNodes.Get(0);
Ptr<NetDevice> dev = node->GetDevice(0);
Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice>(dev);
Ptr<WifiMac> mac = wifi_dev->GetMac();
PointerValue ptr;
mac->GetAttribute("DcaTxop", ptr);
Ptr<DcaTxop> dca = ptr.Get<DcaTxop>();
dca->SetMinCw(minCw);
dca->SetMaxCw(maxCw);
//dca->SetAifsn(2);
Ptr<EdcaTxopN> edca;
mac->GetAttribute("VO_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2);
mac->GetAttribute("VI_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2);
mac->GetAttribute("BE_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2);
mac->GetAttribute("BK_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2)
Simulator::Schedule(Seconds(1.0), &chaan, node, minCw, maxCw);
}
Simulator::Schedule(Seconds(10.0), &chaan, wifiStaNodes.Get(0), 2,2);