Hi Konstantinos!
Thank you for your reply!
Your suggested method works fine!
This method works without putting the cw inside a method and then scheduling it later on , but i do not know why
this is what I have tried :
I made the input for the function as follows: the node, min and max CW
void chaan( Ptr<Node> node, uint32_t minCw, uint32_t maxCw )
{
//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)
}
Then inside the main, I added the scheduling as follows:
Simulator::Schedule(Seconds(20.0), &chaan, wifiStaNodes.Get(0), 2,2);