how to get an instance of StaWifiMac from WifiMacHelper

21 views
Skip to first unread message

Geovany Teca

unread,
Oct 16, 2021, 1:48:08 PM10/16/21
to ns-3-users
Hi All,
I want to change the behavior of one station in wifi network (generate more many probe requests), but leave the remaining with the default behavior (generate only one probe request). Since we create MAC layer from WifiMacHelper I need at least two instances of StaWifiMac from WifiMacHelper.
Ex:
WifiMacHelper staMac1;
WifiMacHelper staMac2;
staMac1.ObjectOfStaWifiMac ;
staMac2.ObjectOfStaWifiMac ;

Best regards
Geovani 

Geovany Teca

unread,
Oct 17, 2021, 7:13:41 AM10/17/21
to ns-3-users
I solved, if it might help someone, there the possibility to configure the MAC layer of a specific station that we want to change the default configuration.

Ptr<NetDevice> dev = wifiStaNodes.Get (0)->GetDevice (0);
Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
Ptr<WifiMac> wifiMac = wifi_dev->GetMac(); 
Ptr<StaWifiMac> staWifi = DynamicCast<StaWifiMac> (wifiMac);

// staWifi->method()

Reply all
Reply to author
Forward
0 new messages