Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Provide a S4U function to control the SNR level of an host on a wifi link (+documenta...
[simgrid.git] / teshsuite / surf / wifi_usage / wifi_usage.cpp
index 1d5e849..6265626 100644 (file)
@@ -4,10 +4,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u.hpp"
+#include "xbt/config.hpp"
 #include "xbt/log.h"
 
-#include "simgrid/msg.h"
-#include "src/surf/network_wifi.hpp"
+#include "src/surf/network_interface.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[usage] wifi_usage <platform-file>");
 
@@ -72,8 +72,9 @@ void run_ping_test(const char* src, const char* dest, int data_size)
              simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
   });
   simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
-  auto* l = (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
-  l->set_host_rate(simgrid::s4u::Host::by_name(src), 0);
+  auto* ap1 = simgrid::s4u::Link::by_name("AP1");
+  ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(src), 0);
+  ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(dest), 0);
   simgrid::s4u::this_actor::sleep_for(10);
   XBT_INFO("\n");
 }