paper-lowrate-iot/ns3-simulator/modules/callbacks.cc

11 lines
453 B
C++
Raw Normal View History

2019-04-12 13:52:06 +02:00
#include "modules.hpp"
void PktReceived(std::string nodeName,Ptr< const Packet > packet, const Address &address){
2019-04-12 16:45:24 +02:00
NS_LOG_UNCOND("Node " << nodeName << " receive a packet" << " at time " << Simulator::Now ().GetSeconds () << "s");
2019-04-12 13:52:06 +02:00
}
void EnergyUpdated(std::string nodeName,double oldValue, double newValue){
2019-04-12 16:45:24 +02:00
NS_LOG_UNCOND("Node " << nodeName << " consumes " << newValue-oldValue << "J" << " at time " << Simulator::Now ().GetSeconds () << "s");
2019-04-12 13:52:06 +02:00
}