OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 YansWifiChannelHelper channel = YansWifiChannelHelper::Default (); | 84 YansWifiChannelHelper channel = YansWifiChannelHelper::Default (); |
85 YansWifiPhyHelper phy = YansWifiPhyHelper::Default (); | 85 YansWifiPhyHelper phy = YansWifiPhyHelper::Default (); |
86 phy.SetChannel (channel.Create ()); | 86 phy.SetChannel (channel.Create ()); |
87 | 87 |
88 WifiHelper wifi = WifiHelper::Default (); | 88 WifiHelper wifi = WifiHelper::Default (); |
89 wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); | 89 wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); |
90 | 90 |
91 NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); | 91 NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); |
92 ·· | 92 ·· |
93 Ssid ssid = Ssid ("ns-3-ssid"); | 93 Ssid ssid = Ssid ("ns-3-ssid"); |
94 mac.SetType ("ns3::NqstaWifiMac",· | 94 mac.SetType ("ns3::StaWifiMac", |
95 "Ssid", SsidValue (ssid), | 95 "QosSupported", BooleanValue (false), |
96 "ActiveProbing", BooleanValue (false)); | 96 "Ssid", SsidValue (ssid), |
| 97 "ActiveProbing", BooleanValue (false)); |
97 | 98 |
98 NetDeviceContainer staDevices; | 99 NetDeviceContainer staDevices; |
99 staDevices = wifi.Install (phy, mac, wifiStaNodes); | 100 staDevices = wifi.Install (phy, mac, wifiStaNodes); |
100 | 101 |
101 mac.SetType ("ns3::NqapWifiMac",· | 102 mac.SetType ("ns3::ApWifiMac", |
102 "Ssid", SsidValue (ssid)); | 103 "QosSupported", BooleanValue (false), |
| 104 "Ssid", SsidValue (ssid)); |
103 | 105 |
104 NetDeviceContainer apDevices; | 106 NetDeviceContainer apDevices; |
105 apDevices = wifi.Install (phy, mac, wifiApNode); | 107 apDevices = wifi.Install (phy, mac, wifiApNode); |
106 | 108 |
107 MobilityHelper mobility; | 109 MobilityHelper mobility; |
108 | 110 |
109 mobility.SetPositionAllocator ("ns3::GridPositionAllocator", | 111 mobility.SetPositionAllocator ("ns3::GridPositionAllocator", |
110 "MinX", DoubleValue (0.0), | 112 "MinX", DoubleValue (0.0), |
111 "MinY", DoubleValue (0.0), | 113 "MinY", DoubleValue (0.0), |
112 "DeltaX", DoubleValue (5.0), | 114 "DeltaX", DoubleValue (5.0), |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Simulator::Stop (Seconds (10.0)); | 163 Simulator::Stop (Seconds (10.0)); |
162 | 164 |
163 pointToPoint.EnablePcapAll ("third"); | 165 pointToPoint.EnablePcapAll ("third"); |
164 phy.EnablePcap ("third", apDevices.Get (0)); | 166 phy.EnablePcap ("third", apDevices.Get (0)); |
165 csma.EnablePcap ("third", csmaDevices.Get (0), true); | 167 csma.EnablePcap ("third", csmaDevices.Get (0), true); |
166 | 168 |
167 Simulator::Run (); | 169 Simulator::Run (); |
168 Simulator::Destroy (); | 170 Simulator::Destroy (); |
169 return 0; | 171 return 0; |
170 } | 172 } |
OLD | NEW |