int minCw = 32;
int maxCw = minCw;
Ptr<DcaTxop> m_beaconDca = CreateObject<DcaTxop>();
m_beaconDca->SetMinCw(minCw);
m_beaconDca->SetMaxCw(maxCw);
Ptr<EdcaTxopN> m_edca = CreateObject<EdcaTxopN>();
m_edca->SetMinCw(minCw);
m_edca->SetMaxCw(maxCw);
I fixed this problem by getting each node and setting params separately for each node in the network. Also, for EDCA every category has to be defined. Here is the solution;
Ptr<Node> node = stas.Get(i); // Get station from node container
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);
Hello,
I would point out that there is a much simpler way to assign values to all nodes without going through a loop and in a few lines.
here it is:
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VO_EdcaTxopN", UintegerValue (63));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VI_EdcaTxopN", UintegerValue (63));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BE_EdcaTxopN", UintegerValue (63));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BK_EdcaTxopN", UintegerValue (63));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/DcaTxop", UintegerValue (63));
When I replace the line Ptr<NetDevice> dev = node->GetDevice(0); with
Ptr<NetDevice> dev = node->GetDevice(1);
why it generates error.
Please help
Ptr<NetDevice> dev = node->GetDevice(0);
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/83287314-a222-713e-4f00-920d6cee16cf%40tomh.org.
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/6be80eec-4890-30c2-e2b5-0675e55fb07b%40tomh.org.