WifiHelper wifi = WifiHelper::Default();
wifi.SetStandard(WIFI_PHY_STANDARD_80211a); wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode", StringValue("OfdmRate24Mbps"));
YansWifiChannelHelper wifiChannel; // = YansWifiChannelHelper::Default (); wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel"); wifiChannel.AddPropagationLoss("ns3::ThreeLogDistancePropagationLossModel"); wifiChannel.AddPropagationLoss("ns3::NakagamiPropagationLossModel");
YansWifiPhyHelper wifiPhyHelper = YansWifiPhyHelper::Default(); wifiPhyHelper.SetChannel(wifiChannel.Create()); wifiPhyHelper.Set("TxPowerLevels",UintegerValue(2)); wifiPhyHelper.Set("TxPowerStart", DoubleValue(10)); wifiPhyHelper.Set("TxPowerEnd", DoubleValue(20));
NqosWifiMacHelper wifiMacHelper = NqosWifiMacHelper::Default(); wifiMacHelper.SetType("ns3::AdhocWifiMac");
NetDeviceContainer aps;
Ptr<NetDevice> device = aps.Get (0); Ptr<WifiNetDevice> wifiDevice = DynamicCast<WifiNetDevice> (device); Ptr<WifiPhy> phy = wifiDevice->GetPhy ();
Ptr<NetDevice> device = wifiNetDevices.Get(i); Ptr<WifiNetDevice> wifiDevice = DynamicCast<WifiNetDevice> (device); Ptr<YansWifiPhy> phy = DynamicCast<YansWifiPhy>(wifiDevice->GetPhy()); phy->SetTxPowerStart(20); phy->SetTxPowerEnd(20);
I have the same problem, I set the Txpower to -100000 dbm but my receiver gets also the udp packets. If your problem is solved. Would you please send me your code?
I did what you said, but I have still peoblem with it.
Br
Hadi
Hadi...@gmail.com