mirror of
https://gitlab.com/manzerbredes/paper-lowrate-iot.git
synced 2025-05-01 01:17:46 +00:00
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
![]() |
#include "modules/modules.hpp"
|
||
|
|
||
|
NS_LOG_COMPONENT_DEFINE ("WIFISensorsSimulator");
|
||
|
|
||
|
|
||
|
int main(int argc, char* argv[]){
|
||
|
|
||
|
uint32_t sensorsFrequency=1;
|
||
|
uint32_t sensorsPktSize=150;
|
||
|
uint32_t sensorsNumber=2;
|
||
|
uint32_t nbHop=5;
|
||
|
|
||
|
CommandLine cmd;
|
||
|
cmd.AddValue ("sensorsSendInterval", "Number of temperature measurement per second", sensorsFrequency);
|
||
|
cmd.AddValue ("sensorsPktSize", "Sensor measurements packet size (bytes)", sensorsPktSize);
|
||
|
cmd.AddValue ("sensorsNumber", "Number of sensors", sensorsNumber);
|
||
|
cmd.AddValue ("nbHop", "Number of hop between AP and Cloud sensors", sensorsNumber);
|
||
|
cmd.Parse (argc, argv);
|
||
|
|
||
|
//LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||
|
//LogComponentEnable("PacketSink", LOG_LEVEL_INFO);
|
||
|
|
||
|
// Setup Simulations
|
||
|
CloudInfos cloud=buildEdgeAndCloud(nbHop);
|
||
|
Cell c=createCell(sensorsNumber,cloud.first.Get(0));
|
||
|
applyScenarios(c,sensorsPktSize,sensorsFrequency,cloud); // Send data from Sensors to Cloud
|
||
|
// setupEnergy(c);
|
||
|
Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// Run simulators
|
||
|
Simulator::Stop (Seconds (20));
|
||
|
Simulator::Run ();
|
||
|
Simulator::Destroy (); // Destroy
|
||
|
|
||
|
|
||
|
|
||
|
return(0);
|
||
|
}
|