stack.Install(ns3_node_);
}
+void resumeWifiDevice(ns3::Ptr<ns3::WifiNetDevice> device) {
+ device->GetPhy()->ResumeFromOff();
+}
+
/*************
* Callbacks *
*************/
netDevices.Add(wifi.Install(wifiPhy, wifiMac, station_ns3_node));
}
+ const char* start_time = wifizone->get_property("start_time");
+ int start_time_value = start_time ? atoi(start_time) : 0;
+ auto resume = [](ns3::Ptr<ns3::WifiNetDevice> device){device->GetPhy()->ResumeFromOff();};
+ for (int i = 0; i < netDevices.GetN(); i++) {
+ ns3::Ptr<ns3::WifiNetDevice> device = ns3::StaticCast<ns3::WifiNetDevice>(netDevices.Get(i));
+ device->GetPhy()->SetOffMode();
+ ns3::Simulator::Schedule(
+ ns3::Seconds(start_time_value),
+ &resumeWifiDevice,
+ device);
+ }
+
ns3::Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", ns3::UintegerValue(40));
mobility.SetPositionAllocator(positionAllocS);