/*
create the mesh part
*/
mesh_nodes.Create (6); // Create 6 nodes mesh
// Configure YansWifiChannel
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
/*
* Create mesh helper and set stack installer to it
* Stack installer creates all needed protocols and install them to
* mesh point device
*/
mesh = MeshHelper::Default ();
if (!Mac48Address (m_root.c_str ()).IsBroadcast())
{
mesh.SetStackInstaller (m_stack, "Root", Mac48AddressValue (Mac48Address (m_root.c_str ())));
}
else
{
//If root is not set, we do not use "Root" attribute, because it
//is specified only for 11s
mesh.SetStackInstaller (m_stack);
}
if (m_chan)
{
mesh.SetSpreadInterfaceChannels (MeshHelper::SPREAD_CHANNELS);
}
else
{
mesh.SetSpreadInterfaceChannels (MeshHelper::ZERO_CHANNEL);
}
mesh.SetMacType ("RandomStart", TimeValue (Seconds (m_randomStart)));
// Set number of interfaces for mesh node
mesh.SetNumberOfInterfaces (m_MeshnIfaces, m_APnIfaces);
// set mesh standard
mesh.SetStandard(WIFI_PHY_STANDARD_80211n_5GHZ, WIFI_PHY_STANDARD_80211n_2_4GHZ);
// Install protocols and return container if default MeshPointDevices
mesh_NetDevices = mesh.Install (wifiPhy, mesh_nodes);
// Setup mobility - static topology for Mesh nodes
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc =
CreateObject<ListPositionAllocator>();
positionAlloc->Add (Vector (330.0, 380.0, 0.0));// AP in Building 1
positionAlloc->Add (Vector (500.0, 300.0, 0.0));// AP in Building 2
positionAlloc->Add (Vector (740.0, 350.0, 0.0));// AP in Building 3
positionAlloc->Add (Vector (250.0, 800.0, 0.0));// AP in Building 4 : the root node
positionAlloc->Add (Vector (500.0, 740.0, 0.0));// AP in Building 5
positionAlloc->Add (Vector (720.0, 720.0, 0.0));// AP in Building 6
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (mesh_nodes);
[1055/1811] cxx: build/src/mesh/bindings/ns3module.cc -> build/src/mesh/bindings/ns3module.cc.7.o
src/mesh/bindings/ns3module.cc: In function ‘PyObject* _wrap_PyNs3MeshHelper_SetNumberOfInterfaces(PyNs3MeshHelper*, PyObject*, PyObject*)’:
src/mesh/bindings/ns3module.cc:16194:49: error: no matching function for call to ‘ns3::MeshHelper::SetNumberOfInterfaces(unsigned int&)’
src/mesh/bindings/ns3module.cc:16194:49: note: candidate is:
./ns3/mesh-helper.h:144:8: note: void ns3::MeshHelper::SetNumberOfInterfaces(uint32_t, uint32_t)
./ns3/mesh-helper.h:144:8: note: candidate expects 2 arguments, 1 provided
src/mesh/bindings/ns3module.cc: In function ‘PyObject* _wrap_PyNs3MeshHelper_SetStandard(PyNs3MeshHelper*, PyObject*, PyObject*)’:
src/mesh/bindings/ns3module.cc:16277:36: error: no matching function for call to ‘ns3::MeshHelper::SetStandard(ns3::WifiPhyStandard&)’
src/mesh/bindings/ns3module.cc:16277:36: note: candidate is:
./ns3/mesh-helper.h:121:8: note: void ns3::MeshHelper::SetStandard(ns3::WifiPhyStandard, ns3::WifiPhyStandard)
./ns3/mesh-helper.h:121:8: note: candidate expects 2 arguments, 1 provided
./waf --disable-python
but the errors are not fixed.
Best regards.
mesh.SetNumberOfInterfaces (m_nIfaces);
// set mesh standard
mesh.SetStandard(WIFI_PHY_STANDARD_80211n_5GHZ);
// Install protocols and return container if default MeshPointDevices
mesh_NetDevices = mesh.Install (wifiPhy, mesh_nodes);
// Setup mobility - static topology for default AP
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc =
CreateObject<ListPositionAllocator>();
positionAlloc->Add (Vector (330.0, 380.0, 0.0));// AP in Building 1
positionAlloc->Add (Vector (500.0, 300.0, 0.0));// AP in Building 2
positionAlloc->Add (Vector (740.0, 350.0, 0.0));// AP in Building 3
positionAlloc->Add (Vector (250.0, 800.0, 0.0));// AP in Building 4 : the root node
positionAlloc->Add (Vector (500.0, 740.0, 0.0));// AP in Building 5
positionAlloc->Add (Vector (720.0, 720.0, 0.0));// AP in Building 6
mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (mesh_nodes);
// create the wifi part
// Create 7 nodes wifi
wifi_AP_nodes.Add(mesh_nodes);// create 6 AP
wifi_AP_nodes.Create (1); // add the second node in building 1
mobility.Install (wifi_AP_nodes.Get(6));
// Create wifi helper and set the wifi frequence at 2.4 GHz
wifi.SetStandard(WIFI_PHY_STANDARD_80211n_2_4GHZ);
QosWifiMacHelper mac = QosWifiMacHelper::Default();
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("OfdmRate54Mbps"));
Ssid ssid = Ssid ("ns-3-ssid");
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
"BeaconGeneration", BooleanValue (true),
"BeaconInterval", TimeValue (Seconds (5)));
wifi_AP_NetDevices = wifi.Install (wifiPhy, mac, wifi_AP_nodes);