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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 wifiStaNodes.Create (nWifi); | 82 wifiStaNodes.Create (nWifi); |
83 NodeContainer wifiApNode = p2pNodes.Get (0); | 83 NodeContainer wifiApNode = p2pNodes.Get (0); |
84 | 84 |
85 YansWifiChannelHelper channel = YansWifiChannelHelper::Default (); | 85 YansWifiChannelHelper channel = YansWifiChannelHelper::Default (); |
86 YansWifiPhyHelper phy = YansWifiPhyHelper::Default (); | 86 YansWifiPhyHelper phy = YansWifiPhyHelper::Default (); |
87 phy.SetChannel (channel.Create ()); | 87 phy.SetChannel (channel.Create ()); |
88 | 88 |
89 WifiHelper wifi = WifiHelper::Default (); | 89 WifiHelper wifi = WifiHelper::Default (); |
90 wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); | 90 wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); |
91 | 91 |
| 92 NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); |
| 93 ·· |
92 Ssid ssid = Ssid ("ns-3-ssid"); | 94 Ssid ssid = Ssid ("ns-3-ssid"); |
93 wifi.SetMac ("ns3::NqstaWifiMac",· | 95 mac.SetType ("ns3::NqstaWifiMac",· |
94 "Ssid", SsidValue (ssid), | 96 "Ssid", SsidValue (ssid), |
95 "ActiveProbing", BooleanValue (false)); | 97 "ActiveProbing", BooleanValue (false)); |
96 | 98 |
97 NetDeviceContainer staDevices; | 99 NetDeviceContainer staDevices; |
98 staDevices = wifi.Install (phy, wifiStaNodes); | 100 staDevices = wifi.Install (phy, mac, wifiStaNodes); |
99 | 101 |
100 wifi.SetMac ("ns3::NqapWifiMac",· | 102 mac.SetType ("ns3::NqapWifiMac",· |
101 "Ssid", SsidValue (ssid), | 103 "Ssid", SsidValue (ssid), |
102 "BeaconGeneration", BooleanValue (true), | 104 "BeaconGeneration", BooleanValue (true), |
103 "BeaconInterval", TimeValue (Seconds (2.5))); | 105 "BeaconInterval", TimeValue (Seconds (2.5))); |
104 | 106 |
105 NetDeviceContainer apDevices; | 107 NetDeviceContainer apDevices; |
106 apDevices = wifi.Install (phy, wifiApNode); | 108 apDevices = wifi.Install (phy, mac, wifiApNode); |
107 | 109 |
108 MobilityHelper mobility; | 110 MobilityHelper mobility; |
109 | 111 |
110 mobility.SetPositionAllocator ("ns3::GridPositionAllocator", | 112 mobility.SetPositionAllocator ("ns3::GridPositionAllocator", |
111 "MinX", DoubleValue (0.0), | 113 "MinX", DoubleValue (0.0), |
112 "MinY", DoubleValue (0.0), | 114 "MinY", DoubleValue (0.0), |
113 "DeltaX", DoubleValue (5.0), | 115 "DeltaX", DoubleValue (5.0), |
114 "DeltaY", DoubleValue (10.0), | 116 "DeltaY", DoubleValue (10.0), |
115 "GridWidth", UintegerValue (3), | 117 "GridWidth", UintegerValue (3), |
116 "LayoutType", StringValue ("RowFirst")); | 118 "LayoutType", StringValue ("RowFirst")); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 Simulator::Stop (Seconds (10.0)); | 164 Simulator::Stop (Seconds (10.0)); |
163 | 165 |
164 PointToPointHelper::EnablePcapAll ("third"); | 166 PointToPointHelper::EnablePcapAll ("third"); |
165 YansWifiPhyHelper::EnablePcap ("third", apDevices.Get (0)); | 167 YansWifiPhyHelper::EnablePcap ("third", apDevices.Get (0)); |
166 CsmaHelper::EnablePcap ("third", csmaDevices.Get (0), true); | 168 CsmaHelper::EnablePcap ("third", csmaDevices.Get (0), true); |
167 | 169 |
168 Simulator::Run (); | 170 Simulator::Run (); |
169 Simulator::Destroy (); | 171 Simulator::Destroy (); |
170 return 0; | 172 return 0; |
171 } | 173 } |
OLD | NEW |