X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3b2cba76f01c60f2dea5ff0b1cb0b30931f90748..4793471eebd395a61c9c681f516fed0fdce1c2a9:/src/surf/network_ns3.cpp diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 8bad9179dc..cfc22c29e6 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -150,14 +150,10 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone) { const char* start_time = wifizone->get_property("start_time"); int start_time_value = start_time ? atoi(start_time) : 0; - auto resume = [](ns3::Ptr device){device->GetPhy()->ResumeFromOff();}; - for (int i = 0; i < netDevices.GetN(); i++) { - ns3::Ptr device = ns3::StaticCast(netDevices.Get(i)); - device->GetPhy()->SetOffMode(); - ns3::Simulator::Schedule( - ns3::Seconds(start_time_value), - &resumeWifiDevice, - device); + for (uint32_t i = 0; i < netDevices.GetN(); i++) { + ns3::Ptr device = ns3::StaticCast(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));